Home > Article > Web Front-end > The code implemented by jquery to change the fixed layer into a positioning layer when the screen exceeds the screen_jquery
A very good user experience example. If you don’t understand, just look at the picture below.
Taobao product list http://search1.taobao.com/browse/50010388/…
Tencent Finance Industrial Economy http://finance.qq.com/industry/index.htm
How to achieve it?
What is scrollTop? When the height of the content inside the element exceeds the height of the element itself, a scroll bar will appear. The height of the upper part that is hidden as the scroll bar is dragged is the scrollTop value.
This kind of positioning layer means that when the page triggers the onscroll event, the scrollTop value is obtained and written into the positioning layer CSS attribute to maintain the position.
The following is the example code
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家
jb51.net jb51.net jb51.net jb51.net 脚本之家