If this is the jquery.keynav plugin that you use, then it works fine even with the latest jQuery (v1.6.1). When calculating, ASCII is a character encoding scheme, and 13 is the number of the β΅ (Enter) key (see ASCII Control Characters ).
The jQuery plugin is for the arrow keys β β β β to move the selection box and the β΅ key to launch .click() .
Here is a demo that uses the plugin. You will need to save the plugin code as jquery.keynav.js and place this file in the same directory as the demo code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script> <script src="jquery.keynav.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $('#keynavDemo div').keynav('keynav_focusbox','keynav_box'); $('#keynavDemo div:first').removeClass().addClass('keynav_focusbox'); </script> <style type="text/css"> #keynavDemo { position:relative; } .keynav_box, .keynav_focusbox { position:absolute; height:30px; width:30px; border:1px solid black; } .keynav_box { background-color:green; } .keynav_focusbox { background-color:red; } </style> </head> <body> <div id="keynavDemo"> <div class='keynav_box' style='left:0px'>0:0</div> <div class='keynav_box' style='left:50px'>0:1</div> <div class='keynav_box' style='left:100px'>0:2</div> <div class='keynav_box' style='left:150px'>0:3</div> <div class='keynav_box' style='left:200px'>0:4</div> <div class='keynav_box' style='left:250px'>0:5</div> <div class='keynav_box' style='left:300px'>0:6</div> <div class='keynav_box' style='left:350px'>0:7</div> <div class='keynav_box' style='left:400px'>0:8</div> <div class='keynav_box' style='left:450px'>0:9</div> </div> </body> </html>
Credit of the author of the plugin , where I "borrowed" a demo from :-)
andyb May 22 '11 at 13:33 2011-05-22 13:33
source share