Webanizr Logo
Open / sluit menu
Module scrollBars

The module scrollBars handles the display of scrollbars as well as scrolling funtions. The module has a collect and a send method.

The scrollBars module uses the Overlay Scrollbars plugin as bases for all functionality.

syntax (collect)

webanizr.collect('scrollBars', parameters, callback)

The collect function can be used to transform a div or body element into a scrollable element. To perform scroll functions on a element, it has to be transformed to a scrollable element.

parameters

The collect method of scrollBars accepts the following parameters.

query__selector (required)

The selector that defines which element(s) you want to convert into scrollable element(s). This uses te query selector syntax: "#mydiv" or ".mydivs"

id__elements (required)

The id you assign to to this / these elements. You need this id in the send method to perform scroll functions

callback

The callback function that is called after the elements are converted to scrollable elements. There is no data passed to this callback function.

syntax (send)

webanizr.send('scrollBars', data, parameters, callback)

The send function is used to perform scroll actions on the scrollable element(s).

data

The data parameter is not used at this point.

parameters

The send method of scrollBars accepts the following parameters:

id__elements (required)

The id of the scrollable element(s). This has to be the id you assigned in to the element(s) in the collect method.

type__action (required)

The type of action you want to perform on scrollable elements. The following types are supported:

  • scroll: scroll the scrollable element to a desired position.

y__position (optional)

The y position you want to scroll to. This parameter is used by the scroll action. You can use css like syntax: 50px, 100% or 0.

x__position (optional)

The x position you want to scroll to. This parameter is used by the scroll action. You can use css like syntax: 50px, 100% or 0.

callback

The callback function that is called after the actions are performed. The callback function is called with the unaltered data.

demo

A simple scroll demo:

https://cdn.cpmodules.webanizr.com/demo/scrolling/index.html