Summary of jQuery plug-ins commonly used in website development (13) Positioning plug-in scrollto

Source: Internet
Author: User

I. scrollto plug-in Function

Scrollto is used to locate the position of elements on the page and scroll the scroll bar to the current element.

Ii. Official scrollto address

Https://github.com/flesler/jquery.scrollTo

There is no detailed description in the official address, but the plug-in can be rolled by the X axis and Y axis. The element can be nested, and the current element will scroll in the parent element. The official demo download is provided. There are application cases in the demo, such as scrolling in the parent element and the interval between scrolling and positioning.

Iii. How to Use scrollto

1. File Reference. You only need to reference two js files, one jquery file and one plug-in function file.

 

2.css Style File. Style is not required for the plug-in itself

3. js Code. Plug-ins are easy to use, such:

$. ScrollTo ('# wrap> h3: eq (3)', 800 $. scrollTo ('# wrap> h3: eq (3)', 800, {axis: 'X '});

4.html code. Specifies the element to be located.

To improve the efficiency of the test case and use the scrolltofixed plug-in to test the scrollto plug-in, the position of an element remains unchanged when the scrolltofixed plug-in is used for Page scrolling.

Online demonstration: positioning plug-in scrollto

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.