开发者

Help me move Burt Reynolds Face - jQuery

开发者 https://www.devze.com 2023-01-05 19:35 出处:网络
I have a problem with jQuery moving Burt Reynolds face around on the page.开发者_开发技巧 My code thus far is:

I have a problem with jQuery moving Burt Reynolds face around on the page.开发者_开发技巧

My code thus far is:

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

But this isn't working :(

PLEASE HELP ME MOVE BURT REYNOLDS FACE!!


how about -

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


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

精彩评论

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