Help me move Burt Reynolds Face - jQuery

前端 未结 2 1882
说谎
说谎 2021-02-14 22:57

I have a problem with jQuery moving Burt Reynolds face around on the page.

My code thus far is:

        function moveBurt() {
          $(\'.burt\').ani         


        
相关标签:
2条回答
  • 2021-02-14 23:42

    how about -

    function moveBurt() {
                  $('.burt').animate({'left' : "-=100px"}, 3000, 'linear');
                }
    
    0 讨论(0)
  • 2021-02-14 23:56

    In addition to bharlings answer, I think you should remove the "px":

       $('.burt').animate({'left' : "-=100"}, 3000, 'linear');
    

    because JQuery will need to do arithmic. x.style.left -= 100px is not correct javascript

    0 讨论(0)
提交回复
热议问题