There is a long page, where a lot of content. The page is divided into sections, such as landing. In the body of the page, when it is scrolled there is a block 100% high of the screen. So: is it possible to make the page automatically scroll to the top of this block when scrolling the page, as soon as this block hits the visible part of the screen? Something like scrolling the page in sections. I need this principle to work only for one block / section on this page. The whole plugin is not needed for this, and it is not suitable. The page has a script of modal windows (there are a lot of them on the page with a lot of content), it also stops working correctly with similar plugins, namely scrolling does not work correctly, which is obvious. Therefore, this effect is needed only for a fragment of the page. Thank you for your help!
I wrote a script, but it does not work. What could be the error? Correct, please.
$(window).scroll(function() { if(document.body.scrollTop === 0) { $('#anchor') $('html, body').animate({scrollTop: $('#anchor').offset().top}, 2000); return false;}); } });
scrollmouse to check whether the block is visible. If yes, scroll to this block. - xaja