Click the links below to understand how each imported script works:
universalsmoothscroll-min.js
(see below)universalsmoothscroll-ease-functions-min.js
universalsmoothscroll-dev-helpers-min.js
The universalsmoothscroll-min.js
script will declare and initialize the uss
object as a public property of Window
.
The uss
object's properties are the API's functionalities and they can either be:
The uss
's variables
are initialized after the window's load event
so you should wait for it
in order to use the API's functionalities.
These variables
SHOULD NOT be directly manipulated: always use the provided accessors.
You will be able to recognize those internal variables
because their names begin with an _
(underscore).
For instance:
//This is the name of the internal variable used by the uss object.
uss._xStepLength
//These are the accessors for the uss._xStepLength variable.
uss.getXStepLength() //Getter
uss.setXStepLength() //Setter
The main scrolling functions
are:
scrollXTo
,scrollYTo
andscrollTo
scrollXBy
,scrollYBy
andscrollBy
scrollIntoView
andscrollIntoViewIfNeeded
Any scroll-animation can be stopped at any time by using:
There's also a handy function for anchor's smooth scrolling management:
The documentation about the API's functions is available in the Available Functions
section.