Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JAVASCRIPT KEYDOWN AROW

document.onkeydown = checkKey;

function checkKey(e) {

    e = e || window.event;

    if (e.keyCode == '38') {
        // up arrow
    }
    else if (e.keyCode == '40') {
        // down arrow
    }
    else if (e.keyCode == '37') {
       // left arrow
    }
    else if (e.keyCode == '39') {
       // right arrow
    }

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JAVASCRIPT #KEYDOWN #AROW
ADD COMMENT
Topic
Name
1+7 =