Public methods

Method name:
refresh
Determination:
The refresh() method recalculates the positions associated with elements in the ScrollMoo object, such as triggerStart, triggerEnd, indicatorStart, indicatorEnd and others. While these positions are automatically updated when the document window is resized (via the resize event), you may need to call this method manually. For example, if you make changes to the DOM that affect on the initially recorded positions, you should invoke the refresh() method to ensure that the calculations remain accurate and up-to-date for the next scroll.
let SM = ScrollMoo({...});
SM.refresh();
Method name:
destroy(restoreStyle = false)
Default:
false
Determination:
destroy() method indicates to stop the animations immediately, and remove all event listeners, and caches. The destroy() method accepts one argument. If set to true, ScrollMoo restores the original styles of all selected elements. Otherwise, the elements remain in their last rendered state.
let SM = ScrollMoo({...});
SM.destroy(); // SM.destroy(true);