fadeOut not working in IE7/IE8

≯℡__Kan透↙ 提交于 2019-12-08 12:15:22

问题


I'm not quite sure why this bit of jQuery isn't working in IE7 & IE8. Does anyone have any ideas what could be causing this?


回答1:


Well for one thing since you are using jQuery do this without the inline js:

$('input[type=checkbox]').click(function(){
    var checkbox = this;
    if (checkbox.checked) {
        $("#message1").stop(true, true).show().fadeOut(10000);
        $("#message2").hide();
    }
    else {
        $("#message1").stop(true, true).hide();
        $("#message2").stop(true, true).show().fadeOut(10000);
    }
});

Just doing this might fix the IE problem

Fiddle: http://jsfiddle.net/maniator/xMSwQ/5/




回答2:


I got it, I just needed to remove position:relative and it fades out perfectly. I'm not quite sure why that is though...



来源:https://stackoverflow.com/questions/6023909/fadeout-not-working-in-ie7-ie8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!