jQuery动画无法在IE中工作 [英] JQuery animate not working in IE

查看:65
本文介绍了jQuery动画无法在IE中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个条形图,该条形图在Firefox& chrome,但不在Internet Explorer中.有人帮我吗?谢谢你. http://jsfiddle.net/FkUYf/6/

I have a bar graph that works perfectly in firefox & chrome, but doesn't in internet explorer. Anyone help me out? Thank you. http://jsfiddle.net/FkUYf/6/

    $(document).ready(function(){
        $(document).scroll(function() {
           var top = $(document).scrollTop();
           console.log(top);
           if (top > 300) {
              $("#html, #css").animate({width:"100%"}, 2000);
              $("#javascript").animate({width:"40%"}, 2000);
              $("#php").animate({width:"50%"}, 2000);
              $("#mysql").animate({width:"30%"}, 2000);
              $("#wordpress").animate({width:"60%"}, 2000);
           }
        });
    });

推荐答案

尝试一下:

   $(document).ready(function(){
        $(document).scroll(function() {
            var top = $(document).scrollTop();
            console.log(top);
           if (top > 300) {
                          $("#html, #css").animate({width:"100%"}, 2000)
                          $("#javascript").animate({width:"40%"}, 2000);
                          $("#php").animate({width:"50%"}, 2000);
                          $("#mysql").animate({width:"30%"}, 2000);
                          $("#wordpress").animate({width:"60%"}, 2000);
          }
        });
    });

这篇关于jQuery动画无法在IE中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆