dev/js/utils.js
/**
 * Get the offset of a given element
 */
Get the offset of a given element
Get the offset of a given element
function offset(elt) {
    if (elt) {
        var rect = elt.getBoundingClientRect(), bodyElt = document.body;
        return {
            top: rect.top + bodyElt.scrollTop,
            left: rect.left + bodyElt.scrollLeft,
            bottom: (rect.top + bodyElt.scrollTop) + rect.height,
            right: (rect.left + bodyElt.scrollLeft) + rect.width
        }
    }
}
function offset ( elt ) { if ( elt ) { var rect = elt . getBoundingClientRect ( ) , bodyElt = document . body ; return { top : rect . top + bodyElt . scrollTop , left : rect . left + bodyElt . scrollLeft , bottom : ( rect . top + bodyElt . scrollTop ) + rect . height , right : ( rect . left + bodyElt . scrollLeft ) + rect . width } } }
Get the offset of a given element
Get the offset of a given element