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