js/pgnvjs.js
/**
     * Scroll if element is not visible
     * @param element the element to show by scrolling
     */
Scroll if element is not visible
@param element the element to show by scrolling
Scroll if element is not visible @param element the element to show by scrolling
function scrollToView(element){
        var node = element;
        var movesNode = node.offsetParent;
        console.log('Has scrollbar: ' + (movesNode.scrollHeight > movesNode.clientHeight));
        var nodeRect = node.getBoundingClientRect();
        var movesRect = movesNode.getBoundingClientRect();
        if (nodeRect.bottom > (window.innerHeight || document.documentElement.clientHeight)) {
            node.scrollIntoView(false);
        } else if (nodeRect.top <= 0) {
            node.scrollIntoView(true);
        }
    }
function scrollToView ( element ) { var node = element ; var movesNode = node . offsetParent ; console . log ( 'Has scrollbar: ' + ( movesNode . scrollHeight > movesNode . clientHeight ) ) ; var nodeRect = node . getBoundingClientRect ( ) ; var movesRect = movesNode . getBoundingClientRect ( ) ; if ( nodeRect . bottom > ( window . innerHeight || document . documentElement . clientHeight ) ) { node . scrollIntoView ( false ) ; } else if ( nodeRect . top <= 0 ) { node . scrollIntoView ( true ) ; } }
Scroll if element is not visible
 @param element the element to show by scrolling
Scroll if element is not visible @param element the element to show by scrolling