Home  >  Article  >  Backend Development  >  javascript - How to implement scrolling with the page when the WordPress side navigation bar is not high enough?

javascript - How to implement scrolling with the page when the WordPress side navigation bar is not high enough?

WBOY
WBOYOriginal
2016-08-04 09:21:161193browse

When the height is sufficient, the side navigation is fixed and the content does not scroll with the scroll bar. If the page height is not high enough to display all the navigation bar content, the navigation bar will scroll with the page. How is this effect achieved?

Reply content:

When the height is sufficient, the side navigation is fixed and the content does not scroll with the scroll bar. If the page height is not high enough to display all the navigation bar content, the navigation bar will scroll with the page. How is this effect achieved?

Look at the source code to understand it yourself...
pinMenu function of wp-adminjscommon.js

I have not seen the implementation of wp, but my idea is that the div of the sidebar is wrapped by the entire large container, and then the sidebar is set to relative positioning, and both left and top are 0.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn