JimmyBanks JimmyBanks - 5 months ago 27
CSS Question

jQuery animate movement left and right

Using jquery's

i am changing the left attributes value to move a div left or right. Im looking for a way to animate this change as it occurs. Nothing ive tried is working, ive tried jQueryUI's
function, but this moves the whole div, rather than just the 120px movement i need.

This is my current function which is working without an animation:

var lm=$('.plwid').css("left");
lm = (parseInt(lm) + 120);
$('.plwid').css("left", lm);

this is the slide function, it does not work properly as the whole div goes from
, rather than just moving the pixel change


try animate()

    $('.plwid').animate({ left: '+=120' }, 400 );