参考: Fixing IE z-index 这是一个演示代码,但是不知道IE7打开是否正常。在你的页面里面使用下面的js代码试试$(function(){ var zIndexNumber = 1000; // Put your target element(s) in the selector below! $(".gwtWrapInner ul li").each(function() { $(this).css('zIndex', zIndexNumber); zIndexNumber -= 10; });
$(".gwtWrapInner ul li") .mouseenter(function(){ $(this).children("div.gwtIntro").show(); }) .mouseleave(function(){ $(this).children("div.gwtIntro").hide(); }); });
感谢版主,IE6下,你的代码是不是应该改成这样 var liindex = 999; $(".gwtWrapInner ul li").each(function (index, el) { $(this).css('z-index', liindex--); }) $(".gwtWrapInner ul li").mouseenter(function(){ $(this).css("position","relative"); $(this).children("div.gwtIntro").show(); }); $(".gwtWrapInner ul li").mouseleave(function(){ $(this).css("position","static"); $(this).children("div.gwtIntro").hide(); });
版主可能没理解我的意思这个是我想要的效果,
IE7下绝对定位的DIV层没有盖住旁边两个li的img图片
这是一个演示代码,但是不知道IE7打开是否正常。在你的页面里面使用下面的js代码试试$(function(){
var zIndexNumber = 1000;
// Put your target element(s) in the selector below!
$(".gwtWrapInner ul li").each(function() {
$(this).css('zIndex', zIndexNumber);
zIndexNumber -= 10;
});
$(".gwtWrapInner ul li")
.mouseenter(function(){
$(this).children("div.gwtIntro").show();
})
.mouseleave(function(){
$(this).children("div.gwtIntro").hide();
});
});
感谢版主,IE6下,你的代码是不是应该改成这样
var liindex = 999;
$(".gwtWrapInner ul li").each(function (index, el) { $(this).css('z-index', liindex--); })
$(".gwtWrapInner ul li").mouseenter(function(){
$(this).css("position","relative");
$(this).children("div.gwtIntro").show();
});
$(".gwtWrapInner ul li").mouseleave(function(){
$(this).css("position","static");
$(this).children("div.gwtIntro").hide();
});