Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Help me move Burt Reynolds Face - jQuery

Tags:

jquery

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!!

like image 244
Barrie Reader Avatar asked Jul 07 '10 08:07

Barrie Reader


2 Answers

how about -

function moveBurt() {
              $('.burt').animate({'left' : "-=100px"}, 3000, 'linear');
            }
like image 54
bharling Avatar answered Nov 12 '22 17:11

bharling


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

like image 2
Tomas Avatar answered Nov 12 '22 19:11

Tomas