Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 2.74 KB

HowItWorks.md

File metadata and controls

50 lines (37 loc) · 2.74 KB

How it works

Click the links below to understand how each imported script works:

API Script

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:

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.