http://vacations.ctrip.com/grouptravel/p71671s2.html
Please tell me, the TAB menu item in this will always remain at the top when the page is scrolled down, and when the page is pulled up beyond it, it will Follow along.
How to achieve this?
I saw a method as follows, but the DIV will shake, not as beautiful as the one above.
<html><head> <title></title></head><body> <div style="height:960px;background:#330000;">teatteat</div> <div id="t" style="height:24px;background:#000000;color:#ffffff;text-align:center;">teatteat</div> <div style="height:960px;background:#333333;">teatteat</div><script type="text/javascript">document.body.onscroll=function(){ if(document.body.scrollTop>=document.getElementById("t").offsetTop){ document.getElementById("t").style.position="absolute"; document.getElementById("t").style.top=document.body.scrollTop; } else { document.getElementById("t").style.position="static"; document.getElementById("t").style.top=document.body.scrollTop; }} </script></body></html>
Link address: http://www.cnblogs.com/yjzhu/archive/2013/01/18/2866782.html
I don’t know what the above article is This is not the effect LZ wants.
Link address: http://www.cnblogs.com/yjzhu/archive/2013/01/18/2866782.html
I don’t know if the above article is the effect LZ wants.