在以下代码中,带锚点的第一个和第二个图像具有链接,并且在这些图像中,IE中页面加载时标题文本不会隐藏(不透明度为0) 6/IE7或IE8处于Comp模式。所有其他图像工作正常,但我需要,但在他们的链接。在兼容模式下,IE 6/IE7或IE8中的css opacity无法正常工作
这里是JSfiddle
代码FF工作正常,IE8在正常模式下是罚款以及
我会在这里发布整个代码,但其相当长,我遇到了麻烦,这样做。
加js代码
$(window).load(function(){
//for each description div...
$('div.description').each(function(){
//...set the opacity to 0...
$(this).css('opacity', 0);
//..set width same as the image...
$(this).css('width', $(this).siblings('img').width());
//...get the parent (the wrapper) and set it's width same as the image width... '
$(this).parent().css('width', $(this).siblings('img').width());
//...set the display to block
$(this).css('display', 'inline-block');
});
$('div.wrapper').hover(function(){
//when mouse hover over the wrapper div
//get it's children elements with class descriptio
//and show it using fadeTo
//$(this).children('.description').show();
$(this).children('.description').stop().fadeTo(500, 0.7);
},function(){
//when mouse out of the wrapper div
//use fadeTo to hide the div
$(this).children('.description').stop().fadeTo(500, 0);
});
});
它似乎不喜欢这样......
$(this).css('opacity', 0);
可能的重复http://stackoverflow.com/questions/3654842/greying-out-a-button-from-code-behind-does-not-work-in-ie/3654874#3654874 – RPM1984 2010-09-13 00:04:30