Index
Methods
Methods
-
<inner> _initElements()
-
Initialize the wrapper, bind the events
-
<inner> getInnerElement() → {DOMElement}
-
Get the inner element. Use this if you want to access the content of the scroller.
Returns
the inner element
- Type
- DOMElement
-
<inner> getScrollbar(dir, create) → {DOMElement|undefined}
-
Get the scrollbar for one direction. Optionally, the scrollbar is built if it does not exist yet.
Parameters
Name Type Argument Default Description dirString 'x' or 'y'
createBoolean <optional>
false create the scrollbar if it does not exist
Returns
the scrollbar element or undefined if it does not exist yet.
- Type
- DOMElement | undefined
-
<inner> getShadow(dir, create) → {DOMElement|undefined}
-
Get the shadow for one direction. Optionally, the shadow is built if it does not exist yet.
Parameters
Name Type Argument Default Description dirString 'x-start', 'x-end', 'y-start' or 'y-end'
createBoolean <optional>
false create the shadow if it does not exist
Returns
the shadow element or undefined if it does not exist yet.
- Type
- DOMElement | undefined
-
<inner> showShadow(dir, value)
-
Show or hide a shadow.
Parameters
Name Type Description dirString 'x-start', 'x-end', 'y-start' or 'y-end'
valueNumber number of pixels available to scroll. Used to change the intensity of the shadow.
-
<inner> updateActive(event)
-
Update the active scrollbars according to the current pointer position. This will call
updateVisiblein order to update the rendering.Parameters
Name Type Description eventDOMEvent the mouse or touch event to use to know the position of the pointer.
-
<inner> updateVisible()
-
Set the scrollbars visible for one second. This will call
updatein order to update the rendering. -
<protected, inner> _read(y)
-
Access to the DOM to read the sizes needed for the
_writemethod.Parameters
Name Type Description yBoolean true if this is the 'y' direction
-
<protected, inner> _write(y)
-
Update the DOM according to the current scroller state (informations gathered by
_writeand other methods).Parameters
Name Type Description yBoolean true if this is the 'y' direction
-
<inner> update()
-
Update the scroller rendering. This method is debounced using a requestAnimationFrame and won't change anything if the direction informations did not change since the last call.