HotKeys for HREF links
-
hi folks, is it possible to define hotkeys for href-links in the html, so the user may select them by simply pressing this keys ? (w/o having to scroll through the whole page)
-
hi folks, is it possible to define hotkeys for href-links in the html, so the user may select them by simply pressing this keys ? (w/o having to scroll through the whole page)
Hi there, IMO, you can implement this functionality with the client side script. You basically need to do the things: + Capture when a key is pressed, you can create am event handler for the onkeydown[^]/onkeypress[^] events of the body element. + Based on the
keyCode
of the pressed key, you can get the appropriate link and take a proper action. The sample code is something like:function CaptureHotKey(e)
{
if (e.keyCode == 65)//The keyCode of 'A' is 65.
{
//Get the expected link for the keyCode 65.
var href = document.getElementById("link1");//Take the proper action: set focus on it or navigate to its url. href.focus(); //window.location.href = href; } ....
}
....
<body onkeydown="CaptureHotKey(event);">+ [Edit]You can also take a quick look at the ACCESSKEY Attribute | accessKey Property [^][/Edit] -- modified at 22:23 Wednesday 31st August, 2005
-
hi folks, is it possible to define hotkeys for href-links in the html, so the user may select them by simply pressing this keys ? (w/o having to scroll through the whole page)
hi there, u can define a hotkey for href element. So user just simply press Alt+ character that u defined, then the link will get focus. below is the sample code: press Alt-C Hope this helps << >>
-
hi folks, is it possible to define hotkeys for href-links in the html, so the user may select them by simply pressing this keys ? (w/o having to scroll through the whole page)
ACCESSKEY attribute.:) :) Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://deepak.blogdrive.com/