This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14553|Reply: 1

[Angular] Fixed menu/top-level plugin Sticky-Kit bug solution in angular

[Copy link]
Posted on 10/18/2018 4:14:55 PM | | | |
If you need to keep certain elements visible while the user scrolls through the page, Sticky-Kit is a good choice.

It is an open-source jQuery plugin that can help you quickly generate fixed page effects for page elements. Often, when developing the navigation bar, you need a function like this.

Key features:
Support fixed display of multiple elements
Supports the location of the element display and its viewport
It is very simple to use and the class library is very small

Official Website:http://leafo.net/sticky-kit/
GitHub:https://github.com/leafo/sticky-kit

Simple to use:

My Code:



It is not fixed to the top, the template I use can be fixed to the top, I thought at first that I was js wrong, I searched for a long time, and found itstick_in_parent defaults to the nearest parent of the sticky element

I see that my parent element is app-topbar (an auto-generated tag from Angular), but the parent element of the template is div #main-wrapper

So, the modification is as follows:



Done!





Previous:Angular6 project uses scss
Next:insertBefore method, and how to implement the insertAfter method
Posted on 10/18/2018 9:44:45 PM |
I have been researching this for a long time, and finally found it, thank you
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com