悬停效果不透明度ie8

时间:2013-06-20 09:09:21

标签: jquery hover opacity

$(document).ready(function(){
$('.boxgrid.slidedown').hover(function(){
    $(".cover", this).stop().animate({opacity:'0'},{queue:false,duration:300});
}, function() {
    $(".cover", this).stop().animate({opacity:'1'},{queue:false,duration:300});
    });

    //Full Caption Sliding (Hidden to Visible)
    $('.boxgrid.captionfull').hover(function(){
    $(".cover", this).stop().animate({opacity:'1'},{queue:false,duration:250});
    }, function() {
    $(".cover", this).stop().animate({opacity:'0'},{queue:false,duration:250});
    });
});

我在图像上添加悬停效果。 在IE8中,.cover div已经首先出现。 为什么会这样?

1 个答案:

答案 0 :(得分:0)

首先在css中添加.cover {display:none},您是否尝试过使用fadeIn / fadeOut

$(document).ready(function(){
    //Full Caption Sliding (Hidden to Visible)
    $('.boxgrid.captionfull').hover(function(){
    $(".cover", this).fadeIn(250);
    }, function() {
    $(".cover", this).fadeOut(250);
    });
});

如果你想添加.stop()

,你可以调整它
相关问题