This is a JS special effect that floats following the scroll bar, which means that the scroll bar scrolls while the element’s position relative to the screen remains unchanged
There are many similar effects on the Internet. This code has the following advantages in comparison:
1. Compatible with IE6.0 & FF1.5
2. It is very simple to use and is the favorite for beginners. See the instructions below
3. There will be no conflicts between elements. Conflict, there can be n special effects on one page, and there is no code redundancy when using multiple elements
The disadvantages are:
1. Can only be used in documents declared as xHTML
2. It is best to place elements under the body
3. There will inevitably be flickering when scrolling (it is already relatively slight, but those who pursue perfection may find it uncomfortable)
Instructions for use:
Quote JS in the page package, and then set the class to xScrollStick on the div that needs special effects. Of course, don’t forget to write the position you want it to be fixed for each element
Example 1: