简体   繁体   English

jQuery动画在Internet Explorer中不起作用

[英]jQuery animation not working in Internet Explorer

I am coding my website, and a friend of mine was helping me. 我正在编码我的网站,我的一个朋友正在帮助我。 This code does not work on IE 10 (Windows 7). 此代码在IE 10(Windows 7)上不起作用。 I even tried the legacy modes and to no avail. 我什至尝试了传统模式,但无济于事。 Upon clicking on "services" for example, this code would work on FF or Chrome. 例如,点击“服务”后,此代码即可在FF或Chrome上运行。 But, not on IE. 但是,不是在IE上。 Can someone help me fix this code so it would also work on IE? 有人可以帮我修复此代码,以便它也可以在IE上运行吗?

$('#services-fr-2').on('click',function(){

    $(".clientsFr").hide();
    $('.servicesFr').fadeToggle();
    $('#green-pouch-fr').animate({
        'top':'450px'//,
        //'height':'450'
    });

});

EDIT: Here is the fiddle as requested. 编辑:这是根据要求的小提琴。

http://jsfiddle.net/dVMT9/5/ http://jsfiddle.net/dVMT9/5/

You are missing brackets. 您缺少括号。

$('#services-fr-2').on('click',function(){  
        $( ".clientsFr" ).hide();
        $('.servicesFr').fadeToggle();
        $('#green-pouch-fr').animate({
            'top':'450px'//,
            //'height':'450'
        })
});

Your problem is the comma after 'top':'450px' 您的问题是'top':'450px'之后的逗号'top':'450px'

The comma would be fine if the next line wouldn't be commented out. 如果不注释下一行,则逗号会很好。 Remove the comma and IE will be fine. 删除逗号,IE即可。

难道是px'top':'450px' ,我曾经有过一个问题, px ,只是尝试删除它们

I faced same problem in IE9. 我在IE9中也遇到了同样的问题。 I tried top without quotes and it worked. 我尝试没有引号的顶部,它的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM