Check if the passed HTMLElement is in the viewport or not

Name Type Description Status Default
elm { HTMLElement } The element to insert required
offset { Object } An object of top, right, bottom and left offset used to detect the status required

Return { Boolean } If the element is in the viewport or not


    import isInViewport from 'sugarcss/js/dom/isInViewport'
if (isInViewport(myCoolHTMLElement) {
        // i'm in the viewport

Author : Olivier Bossel