jquery 怎么给backgroundPosition做animate动画           

解决方案 »

  1.   


    <script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
    <script>$(function(){
    $('#div1').animate({
    'background-position':100
    });
    });</script>
    <div id="div1" style="height:200px;width:200px;background-image:url(1.png)"></div>
      

  2.   

    参考
    http://serve.netsh.org/serving/demo/jqBackgroundPositionAnimateDemo.view# 
      

  3.   

    你们都打错了 其实是backgroundPositionX
      

  4.   

    backgroundPosition : '(0 -39px)'},
      

  5.   

    $(elem).animate({backgroundPosition : '(0 -39px)'}, 500);