In some websites, the height of the navigation menu changes with the drop down of the page, and when the page is restored to the top, the height is restored again.The effect is as follows:
How to achieve such a navigation bar height changes with the page dragging?This requires the use of the jQuery scroll event $(window). scroll().The following describes the implementation method.
Step 1: Place the following code at the bottom of the website navigation code to monitor the vertical distance between the navigation menu and the scroll bar. After reaching the marked height, a class head_up will be automatically added to the navigation menu;
Step 2: Then add CSS style to the newly added class, and let it control the height of the menu under the new class.Of course, if there are LOGO and pull-down menus in the future, you also need to change the style;
Professionally provide WordPress theme installation, in-depth localization, accelerated optimization and other website construction services. Please consult online customer service for details!