This article mainly introduces jQuery's implementation of fixed navigation effects like Baidu NLP bar headers. It involves jquery's dynamic addition and deletion techniques for page height calculation and style, which is very simple and practical, for more information about jQuery, see the examples in this article. Share it with you for your reference. The details are as follows:
Here, jquery is used to fix the header of the webpage, but it does not scroll with the scroll bar. In the special webpage effects sorted out in Baidu Post Bar, the fixed bar can be dragged to the top of the webpage with the scroll bar at the beginning, but after arriving at the top of the page, drag the scroll bar again, and the header does not scroll. Other content can scroll. It seems that there are quite a lot of effects on the Internet.
The running effect is as follows:
The Code is as follows:
Fixed navigation