I have this code below and the DEMO fiddle.
jQuery(document).ready(function () {
$(window).scroll(function () {
$('html, body').animate({
scrollTop: $('#content').offset().top
}, 1000);
});
});
I'm really confused why I can't scroll up? Anybody can explain to me why and please share some solutions you have.
Any help, is very appreciated.
$(window).scroll()event fires, and automatically animates your scroll top$('#content').offset().top(which is always the same value). So whenever you try to scroll up, it just animates your page scroll back down.