0.0.5 • Published 6 years ago
op-view-progress v0.0.5
op-view-progress
Element's position on the screen / view. Progress is calculated in relation between node's top position, height and window's height. The value is:
-1and less for items under viewport-1 ... 0 ... 1in the viewport, where0is for elements in the middle1and more for items above viewport
Install
npm install op-view-progressyarn add op-view-progressUsage
import opViewProgress from 'op-view-progress';Create instance:
const progress = new opViewProgress(domNode);Update / tick:
progress.tick();Get value:
progress.value;