Scroll area component
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 = ;
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 = scroll: scrollBar step: 5;
Use cases
Add scrollable content to the scroll area:
scrollArea$bodyinnerText = 'Some long long long text to scroll..........';
Re-init of the component with new data:
scrollArea;
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.