2
I have all the code of a fixed sidebar that works perfectly, however I want that as soon as the scroll bar reaches the top of the page, the top itself, an element receive a CSS assignment through the . css().
Something along those lines:
$(window).scroll(function() {
if ($(window).scrollTop() == 0) {
$('#top-tabv2').css({'margin-top': '-1px'});
}
});
How can I proceed? From now on, thank you! =]
Your code seems to be correct. What problem is giving?
– Sam
And that’s right, man! xD I hadn’t noticed this before, because I had given an error in the compilation and for that reason I thought the flaw was in the code, but, thank God, everything is working as expected! Thanks for the return!
– winiercape