Coffeekraken.io 0.0.1

inViewportPercentage

Return how many percent the passed element is visible in the viewport

Name Type Description Status Default
elm { HTMLElement } The element to get the in viewport percentage from required

Return { Number } The percentage visible in the viewport

Example

    import inViewportPercentage from 'sugarcss/js/dom/inViewportPercentage'
const percentage = inViewportPercentage(myCoolHTMLElement);
// 20

Author : Olivier Bossel olivier.bossel@gmail.com