Possible Duplicate:
Subtract from an integer using jquery
I want to subtract 50 from the offset of a div.
My code is this.
if (scroll) {
$('html, body').animate({"scrollTop": $(scroll).offset().top - 50});
$(scroll).css('color', 'blue');
$(scroll).mouseleave(function() {
$(this).css('color', 'black');
});
}
But this isn’t working. Can someone help me ?
You can use
cssmethod to change thetoppropertyDemo.
Update:
Also make sure
if (scroll)evaluates true.DEMO.