开发者

Child elements in div won't fadeTo() in IE

This is strange to me. This code:

$(".layover").fadeTo("fast", 0.0);
$(".layover").hover(function() {
$(this).fadeTo("fast", 0.9);
},
function() {
$(this).fadeTo("fast", 0.0);
});

..works just fine on all browsers except IE7 and IE8. It even works (slowly) in IE6 (screams!) In IE7 and IE8 this code will NOT fade out child elements namely img tags. The img just sit there unaffected. However, if I enable "compatibility mode" in IE8, it wo开发者_JS百科rks as expected. See this example page.

Is there a bit I'm missing in my JavaScript to help IE play nice? Can I force compatibility mode in IE?

And I know someone is going to comment on the FOUC. I'm working on that too.

UPDATE: Here's the CSS portion

div.layover {
position:absolute;
padding:0px;
display:inline-block;
background-color:#fff;
height:106px;
width:312px;
}


This doesn't answer your main question, but I believe changing your first line to this would help fix your FOUC:

$(".layover").hide();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜