We first write the instance, and then we may need to do more advanced processing in the encapsulation as a plug-in and finally!
encapsulation plug-in basic learning http://my.oschina.net/u/2352644/blog/487688
1-7 instance address http://my.oschina.net/u/2352644/blog/490827
8-17 instance address http://my.oschina.net/u/2352644/blog/491933
18-23 Instance Address http://my.oschina.net/u/2352644/blog/497003
Effects Catalog:
24. Relative window positioning when page structure scrolls
25. Back to top
 
24. Relative window positioning when page structure scrolls
principle: Get the element relative to the top of the page to judge the standard, constantly listen to the position of the window scroll bar, more than the top value, add the Position:fixed property, the window is fixed, less than the top value of the removal of properties, Revert to the default page position (hack:position:absolute;bottom:auto;top:expression for IE6 to fixed, which is written to the CSS (eval ( DOCUMENT.DOCUMENTELEMENT.SCROLLTOP)); Using the supported absolute and the expression method used for top fetching)
code:
<! doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "HTTP// Www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 25. Back to top
principle: return to the top is the HTML element of the ScrollTop set to 0, we can be set by the animation of JQ, to achieve the buffer effect (the value of the scroll value we are on the HTML element, get the value is the Window object)
code:
<! doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "HTTP// Www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> JS Sanjiaojiuliu Series-jquery Instance development to plug-in package 4