jQuery animate没有在ie7 / ie8中显示

时间:2013-01-23 14:40:19

标签: jquery

jQuery animate功能仅支持IE9,Firefox,Chrome但不支持< IE 9.有解决方案吗?

/* <![CDATA[ */
$(document).ready(function() {
    $(".subSlogan").animate({"opacity": "-=1", top: 0, left: 0 }, 1);
    $(".subSlogan").animate({"opacity": "-=1", top: 0, left: 0 }, 1000);
    $(".subSlogan").animate({"opacity": "+=1", top: 95, left: 120 }, 1200);

    $(".Slogan").animate({"opacity": "-=1", top: 300, right: 0 }, 1);
    $(".Slogan").animate({"opacity": "-=1", top: 300, right: 0 }, 2000);
    $(".Slogan").animate({"opacity": "+=1", top: 153, left: 180 }, 1200);

    $(".Schweizerkreuz").animate({"opacity": "-=1", top: 155, left: 795 }, 1);
    $(".Schweizerkreuz").animate({"opacity": "-=1", top: 155, left: 795 }, 3500);
    $(".Schweizerkreuz").animate({"opacity": "+=1", top: 155, left: 795 }, 1200);

    $("#logoBox").animate({"opacity": "-=1", top: -250 }, 1);
    $("#logoBox").animate({"opacity": "-=1", top: -250 }, 4000);
    $("#logoBox").animate({"opacity": "+=1", top: 0 }, 1200);
});
/* ]]> */

2 个答案:

答案 0 :(得分:1)

我认为这是一个问题,不透明度在IE中并不完全支持&lt; 9,而不是animate功能的问题。本质上,一个CSS问题,而不是一个jQuery问题。你能为其他CSS属性设置动画吗?

答案 1 :(得分:0)

HTML 5和CSS 3不支持IE7或IE8,但IE9支持IE7或IE8。这就是你的动画无效的原因。所以你的jquery代码中没有错误。