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});
})
精彩评论