急!js动画对css的干扰(冲突)问题!
冲突结果如图所示。图中动画部分的js代码如下:<SCRIPTtype=text/javascript>varwidths=480;varheights=150;varco...
冲突结果如图所示。
图中动画部分的js代码如下:
<SCRIPT type=text/javascript>
var widths=480;
var heights=150;
var counts=2;
img1=new Image ();img1.src='http://localhost/upload_files/label/1_20101029141056_pgxoy.jpg';
url1=new Image ();url1.src='#';
img2=new Image ();img2.src='http://localhost/upload_files/label/1_20101029141000_syjv2.jpg';
url2=new Image ();url2.src='#';
var nn=1;
var key=0;
function change_img()
{if(key==0){key=1;}
else if(document.all)
{document.getElementById("pic").filters[0].Apply();document.getElementById("pic").filters[0].Play(duration=2);}
eval('document.getElementById("pic").src=img'+nn+'.src');
eval('document.getElementById("url").href=url'+nn+'.src');
eval('document.getElementById("url").target="blank"');
for (var i=1;i<=counts;i++){document.getElementById("xxjdjj"+i).className='axx';}
document.getElementById("xxjdjj"+nn).className='bxx';
nn++;if(nn>counts){nn=1;}
tt=setTimeout('change_img()',4000);}
function changeimg(n){nn=n;window.clearInterval(tt);change_img();}
document.write('<style>');
document.write('.axx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');
document.write('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');
document.write('.bxx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('</style>');
document.write('<div style="width:'+widths+'px;height:'+heights+'px;overflow:hidden;text-overflow:clip;">');
document.write('<div><a id="url"><img id="pic" style="border:0px;filter:progid:dximagetransform.microsoft.wipe(gradientsize=1.0,wipestyle=4, motion=forward)" width='+widths+' height='+heights+' /></a></div>');
document.write('<div style="filter:alpha(style=1,opacity=10,finishOpacity=80);background: #888888;width:100%-2px;text-align:right;top:-12px;position:relative;margin:1px;height:12px;padding:0px;margin:0px;border:0px;">');
for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}
document.write('</div></div>');
change_img();
</SCRIPT>
图中三级菜单部分的css代码如下:
.nav .fyiji:hover .erji:hover .sanji:hover ul{display:block;} 展开
图中动画部分的js代码如下:
<SCRIPT type=text/javascript>
var widths=480;
var heights=150;
var counts=2;
img1=new Image ();img1.src='http://localhost/upload_files/label/1_20101029141056_pgxoy.jpg';
url1=new Image ();url1.src='#';
img2=new Image ();img2.src='http://localhost/upload_files/label/1_20101029141000_syjv2.jpg';
url2=new Image ();url2.src='#';
var nn=1;
var key=0;
function change_img()
{if(key==0){key=1;}
else if(document.all)
{document.getElementById("pic").filters[0].Apply();document.getElementById("pic").filters[0].Play(duration=2);}
eval('document.getElementById("pic").src=img'+nn+'.src');
eval('document.getElementById("url").href=url'+nn+'.src');
eval('document.getElementById("url").target="blank"');
for (var i=1;i<=counts;i++){document.getElementById("xxjdjj"+i).className='axx';}
document.getElementById("xxjdjj"+nn).className='bxx';
nn++;if(nn>counts){nn=1;}
tt=setTimeout('change_img()',4000);}
function changeimg(n){nn=n;window.clearInterval(tt);change_img();}
document.write('<style>');
document.write('.axx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');
document.write('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');
document.write('.bxx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('</style>');
document.write('<div style="width:'+widths+'px;height:'+heights+'px;overflow:hidden;text-overflow:clip;">');
document.write('<div><a id="url"><img id="pic" style="border:0px;filter:progid:dximagetransform.microsoft.wipe(gradientsize=1.0,wipestyle=4, motion=forward)" width='+widths+' height='+heights+' /></a></div>');
document.write('<div style="filter:alpha(style=1,opacity=10,finishOpacity=80);background: #888888;width:100%-2px;text-align:right;top:-12px;position:relative;margin:1px;height:12px;padding:0px;margin:0px;border:0px;">');
for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}
document.write('</div></div>');
change_img();
</SCRIPT>
图中三级菜单部分的css代码如下:
.nav .fyiji:hover .erji:hover .sanji:hover ul{display:block;} 展开
展开全部
如果我没猜错,在导航菜单这一块,你应该设置成了:
当onmouseout三级菜单时,会隐藏菜单,如果是,请往下看
从图中可以清楚地看出,页码那个区块挡在了三级菜单的上面,也就是说,把鼠标mouseover到这里时,实际上是移到了页码那个灰色半透明区块,也就是说此时已经mouseout三级菜单,所以就触发了隐藏;如果是这样,再往下看:
解决办法:
把导航菜单里设置了position:relative;元素加个z-index:3(数字自己定,只要比页码的父级(设置了position:relative的元素)数值大就OK),应该就没问题了
当onmouseout三级菜单时,会隐藏菜单,如果是,请往下看
从图中可以清楚地看出,页码那个区块挡在了三级菜单的上面,也就是说,把鼠标mouseover到这里时,实际上是移到了页码那个灰色半透明区块,也就是说此时已经mouseout三级菜单,所以就触发了隐藏;如果是这样,再往下看:
解决办法:
把导航菜单里设置了position:relative;元素加个z-index:3(数字自己定,只要比页码的父级(设置了position:relative的元素)数值大就OK),应该就没问题了
展开全部
IE6?
定位的问题 给左边最外层和右边最外层 设置css position:relative 左边z-index:100 右边:z-index:10;(左边z-index比右边大即可)
定位的问题 给左边最外层和右边最外层 设置css position:relative 左边z-index:100 右边:z-index:10;(左边z-index比右边大即可)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你这个ul是不是绝对定位的?你给这个u或包含ul的这个容器加上z-index:1;试试,不行再说。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询