mag-component-scroll-area

1.0.17 • Public • Published

Scroll area component

build status npm version dependencies status devDependencies status Gitter

Scroll area is a component to build user interface, an instance of Component module.

Installation

npm install mag-component-scroll-area

Usage

Add the constructor to the scope:

var ScrollArea = require('mag-component-scroll-area');

Constructor config

Own properties in addition to inherited from Component:

Name Type Default value Description
step number 5 step to scroll area in % of screen height
realHeight number 0 real height of scroll area
viewHeight number 0 visible height of area
topPosition number 0 top position of scroll container
scroll ScrollBar null associated ScrollBar component link

Create scroll area instance:

var scrollArea = new ScrollArea({
    scroll: scrollBar,
    step: 5
});

Use cases

Add scrollable content to the scroll area:

scrollArea.$body.innerText = 'Some long long long text to scroll..........';

Re-init of the component with new data:

scrollArea.init();

Development mode

There is a global var DEVELOP which activates additional consistency checks and protection logic not available in release mode.

Contribution

If you have any problems or suggestions please open an issue according to the contribution rules.

License

mag-component-scroll-area is released under the MIT License.

Package Sidebar

Install

npm i mag-component-scroll-area

Weekly Downloads

1

Version

1.0.17

License

MIT

Unpacked Size

15.4 kB

Total Files

26

Last publish

Collaborators

  • magsdk