1.0.5 • Published 5 years ago
lazy-listener v1.0.5
Lazy Listener Package
Package has implemented lazy loading for images and videos. Package functions logs informations such as div name, visibility in percent, div height and width. There is also a function that gives information about video duration, current video time and percent of the video played.
List of functions included:
Function | description |
---|---|
config('classname',interval in ms) | set configuration for timer, which is counting how long divs from given class are visible above 50%, |
start() | starts to log informations about percent of visibility and time of visibility above 50% of divs from given class, |
stop() | stops logging informations |
alldiv('classname') | logs informations about every div from given class on your website |
selecteddiv(divname) | logs informations about selected div |
divpos(divname) | logs distance from div footer to the top of site and from div top to the site footer |
time() | logs informations about video |
##How to add to your code:
To use package You have to just add \
<script src="/node_modules/lazy-module-listener/bundle.js"></script>
to your HTML file :sunglasses: