1.0.17 • Published 6 years ago

mag-component-scroll-area v1.0.17

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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:

NameTypeDefault valueDescription
stepnumber5step to scroll area in % of screen height
realHeightnumber0real height of scroll area
viewHeightnumber0visible height of area
topPositionnumber0top position of scroll container
scrollScrollBarnullassociated 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.