Home  >  Article  >  Web Front-end  >  js鼠标滑过弹出层的定位IE6bug解决办法_javascript技巧

js鼠标滑过弹出层的定位IE6bug解决办法_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:45:26988browse

大家在写div+css的时候经常会用到弹出层,由于IE6的bug,所以当使用多个标签重复写弹出层的时候会遇到后面的层压在了弹出层的上面,这种问题在火狐浏览器下可以用z-index来解决,但是在IE6下面是不起作用的,下面的代码给大家提供了一种此类问题的解决办法,原理如下:用Jquery给弹出层的z轴依次增加高度.代码很简单,效果很显著,吼吼!

复制代码 代码如下:





弹出层问题的解决办法








以上JS代码需要引入jquery-1.3.2.min.js文件
关键JS代码
for(var i = 0; i var j = 10000-i
$(".box li").eq(i).css("z-index",j);
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn