答案 0 :(得分:0)
在IE8中,不考虑CSS属性的不透明度。您还需要在悬停情况下执行"filter":"-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"
,并在回调中执行"filter":"-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"
。
您的代码:
$(document).ready(function(){
$("img.a").hover(
function() {
$(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});
});
固定代码:
$(document).ready(function(){
$("img.a").hover(
function() {
$(this).stop().animate({"opacity": "0", "filter" : "-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1", "filter" : "-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"}, "slow");
});
});