JS Sanjiaojiuliu Series-jquery Instance development to plug-in package 4

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.