Has anyone ever encountered a situation where this code doesn’t work:
$('#whatever').css({
left:'+=7px'
});
But this code does:
$('#whatever').animate({
left:'+=7px'
}, 10);
The element Styles are as follows:
#whatever {
position: relative;
position: relative;
width: 800px;
height: 800px;
left: 0px;
top: 0px;
}
I can’t seem to get it to work… Any ideas?!
remove ‘px’ after 7
and check for your jQuery version
As of jQuery 1.6 .css() accepts relative values