Please check out the fiddle to see exactly why it doesn’t work. I’m using jQuery 1.6
Here’s what the documentation says:
As of jQuery 1.6,
.css()accepts relative values similar to.animate().
Doesn’t work:
$('#block').css('top','+=100');
Works:
$('#block').css('top',function(){ return $(this).css('top').replace('px','')+100+'px'; });
it appears to be a jQuery bug – looks like they had a similar bug before with width and other properties (http://bugs.jquery.com/ticket/9237 – be sure to read the comments). Your JS fiddle example works fine if you use height/width but not for positioning it seems