demo/inc/demo.js
function (evt) {
            // Ignore input fields
            if ($(evt.target).is('input')) {
                return true;
            }

            if (evt.shiftKey && 37 <= evt.keyCode && evt.keyCode <= 40) {
                var key = 'key' + evt.keyCode;
                var scrollVals = {
                        key38: [0, -1],
                        key37: [-1, 0],
                        key39: [1, 0],
                        key40: [0, 1]
                    };

                window.scrollBy(scrollVals[key][0], scrollVals[key][1]);
                evt.preventDefault();
            }
        }
function (evt) {
            // Ignore input fields
            if ($(evt.target).is('input')) {
                return true;
            }

            if (evt.shiftKey && 37 <= evt.keyCode && evt.keyCode <= 40) {
                var key = 'key' + evt.keyCode;
                var scrollVals = {
                        key38: [0, -1],
                        key37: [-1, 0],
                        key39: [1, 0],
                        key40: [0, 1]
                    };

                window.scrollBy(scrollVals[key][0], scrollVals[key][1]);
                evt.preventDefault();
            }
        }
function ( evt ) { // Ignore input fields if ( $ ( evt . target ) . is ( 'input' ) ) { return true ; } if ( evt . shiftKey && 37 <= evt . keyCode && evt . keyCode <= 40 ) { var key = 'key' + evt . keyCode ; var scrollVals = { key38 : [ 0 , - 1 ] , key37 : [ - 1 , 0 ] , key39 : [ 1 , 0 ] , key40 : [ 0 , 1 ] } ; window . scrollBy ( scrollVals [ key ] [ 0 ] , scrollVals [ key ] [ 1 ] ) ; evt . preventDefault ( ) ; } }
When shift + arrow key is pressed, nudge the page by 1px
When shift + arrow key is pressed nudge the page by 1px