开发者

Jquery animate not working in IE?

I'm using jquery to animate a background position of an image, it works in modern browsers but not in IE. Any help is much appreciated, thanks :)

$("#btn-home").click(function(){
  $('#line').animate({backgroundPosition: '0px 0', duration:2000});
  })
  $("#btn-intro").click(function(){
  $('#line').animate({backgroundPosition: '116px 0', duration:2000});
  })
  $("#btn-prizes").click(function(){
        $('#line').animate({backgroundPosition: '231px 0', duration:2000});
      })
    $("#btn-part").click(function(){
        $('#line').animate({backgroundPosit开发者_StackOverflow中文版ion: '345px 0', duration:2000});
      })
    $("#btn-prog").click(function(){
        $('#line').animate({backgroundPosition: '460px 0', duration:2000});
      })
    $("#btn-judge").click(function(){
        $('#line').animate({backgroundPosition: '575px 0', duration:2000});
      })
    $("#btn-past").click(function(){
        $('#line').animate({backgroundPosition: '690px 0', duration:2000});
      })


Try this

$('#line').animate({backgroundPosition: '345px 0'}, 2000);


$("#btn-home").click(function(){
  $('#line').animate({backgroundPosition: '0px 0', duration:2000});
  })

Is Wrong.

I don't think there is anything such as duration: {NUMBER} in Animate.

Try:

$("#btn-home").click(function(){
  $('#line').animate({backgroundPosition: '0px 0', 2000});
  })
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜