Jquery sliding boxes not working in IE8

橙三吉。 提交于 2019-12-11 02:07:43

问题


My Jquery code doesn't seem to work in IE8 when adding a doctype above my html tag.

Maybe there's a way to restructure these codes to have it working in ie8.

$(document).ready(function(){
            //Caption Sliding (Partially Hidden to Visible)
            $('.boxgrid.caption').hover(function(){
                $(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
            }, function() {
                $(".cover", this).stop().animate({top:'161px'},{queue:false,duration:160});
            });
        });


The website can be seen here:

http://www.keencloudmedia.com/sample/test.html

Thanks in advance!


回答1:


try this

$(document).ready(function(){
        $('.boxgrid.caption').mouseenter(function(){
            $(".cover", this).stop().animate({'top':'0px'},160);
        });
        $('.boxgrid.caption').mouseleave(function() {
            $(".cover", this).stop().animate({'top':'161px'},160);
        });
    });

and you can use this meta tag (works with jquery excellent)

    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />


来源:https://stackoverflow.com/questions/11200515/jquery-sliding-boxes-not-working-in-ie8

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