tags:

views:

104

answers:

2

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

+8  A: 

how about -

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

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

Tomas
Oh ho, but do behold the power of jQuery! http://api.jquery.com/animate/ Yes, it actually works with `px`.
deceze
I should have tested it. Thanks. I'll leave my answer as I would consider it is better style not to rely on such magic...
Tomas