eyeport
v0.1.0
Published
Collection of useful methods to deal with element and viewports in DOM
Downloads
4
Readme
eyeport
Collection of useful methods to deal with element and viewports in DOM
Install
$ npm install --save eyeport
API
Table of Contents
getPercentageInViewport
Returns the visible percentage of an element in a viewport.
Parameters
element
HTMLElementviewport
HTMLElement
Examples
const { getPercentageInViewport } = require('eyeport')
const element = document.getElementById('myElement')
const viewport = document.getElementById('myContainer')
getPercentageInViewport(element, viewport)
Returns number
License
MIT © Diego Haz