JQuery动画不在IE中工作

时间:2013-03-09 18:58:35

标签: javascript jquery

我有一个条形图,在firefox& chrome,但不在Internet Explorer中。有人帮帮我吗?谢谢。 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);
           }
        });
    });

1 个答案:

答案 0 :(得分:2)

试试这个:

   $(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);
          }
        });
    });