Given an element with unknown margin-left, how to increase its margin-left at a number say 100px?
For example:
assuming the original margin-left is 100px
$('#element-id').css('margin-left', function (index, curValue) { return parseInt(curValue, 10) + 100 + 'px'; });
curValue will include 'px' at the end, so you'll end up with NaN or 100px100px as your result without using parseInt first.
NaN
100px100px
parseInt