Introduction
Now there are more and more scenarios in which web pages use scrollbars to display content, but when the content is too long, users will not know where to scroll to, do not understand the page architecture, and can not quickly locate the information they need to view. This problem can be solved by associating the window scrollbar with the corresponding button on the nav bar.
Features to be Realized
1. When the window scrolls, if it scrolls to a certain position, the corresponding button on the right navigation bar will be selected.
2. When the button on the right is clicked, the window will scroll to the appropriate position.
How to Realize these Features
By adding hot spots to different parts of the page.
1. When the window scrolls, judge the ScrollY of window and the position of hot zone. Then select the corresponding button on the left navigation bar.
2. When clicking the button on the navigation bar, the window will scroll to the position of the corresponding hot zone.