Animate passing variable
Animate passing variable
I am creating a sliding image gallery and am trying to use this line:
$('#images_wrapper').animate({left:"-197px"},1500);
This would move the entire div of images to the left but only works once. I was trying to put the current position-197 in there:
var position = $('#images_wrapper').css("left");
position = position.replace('px','');
This would remove "px" and return 197. How do I place this variable in the upper jQuery statement? I've tried everything I can imagine.
Thanks!