This article mainly introduces jquery+css to achieve the side navigation bar effect in detail. It has certain reference value. Interested friends can refer to it. I hope it can help everyone.
When I was working on a project recently, I suddenly wanted to use a side navigation bar. I found several plug-ins online, but some were too ugly and did not meet my expectations. Instead of modifying other people's code, it's better to write one yourself. Without further ado, here are the pictures. If you are interested, please continue reading.
1. Rendering
When there is a top navigation bar, the side navigation bar will disappear.
#In terms of responsiveness, the icon in the lower right corner appears only after the same top navigation bar disappears. Click to display the navigation, which disappears after selection;
This is a demo without smooth scrolling. You can add it yourself if needed.
That’s all for the introduction, below is the code.
2, css code
Here is the css code, please see the comments for details
3. html code
Here is the html code, it is very simple and there is nothing to say.
4. js code
Let’s take a look at the js code. The notes are very detailed, so I won’t go into details.
How has everyone learned? Hurry up and try it out.
Related recommendations:
vue router imitates Tmall bottom navigation bar example sharing
jQuery implemented sticky scrolling navigation bar Effect
The above is the detailed content of jquery and css to implement side navigation bar effect sample code. For more information, please follow other related articles on the PHP Chinese website!