I have a scenario where I update the left value to show certain part of the div element. In my case the width of the div element is very long. I used the left property to move the div to/fro with animation.
Sample code:
$('.slides .next').live('click', function(){
var pos = $(this).position();
var newLeft = (pos.left - 700);
$(this).animate({left: "-=left"}, 800);
// I also tried this instead of the above=> $(this).animate({left: newLeft}, 800);
});
At some point the left value is getting larger with negative values (say: -8400px). When it goes beyond that, the left is automatically changing to 0px;
Any help greatly appreciated. Thanks