在以下代碼中,帶錨點的第一個和第二個圖像具有鏈接,並且在這些圖像中,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