Assining key to button script

P

P K

Hi,
I'd like to be able to use the arrow keys to trigger my navigation
buttons. How do I specify that a right arrow key (->) is to activate the
link of my right arrow button, and so forth?
Thanks
--Paul
 
B

Bart Van der Donck

P said:
I'd like to be able to use the arrow keys to trigger my navigation
buttons. How do I specify that a right arrow key (->) is to activate the
link of my right arrow button, and so forth?

I 'm afraid that not every navigation button can be replaced by a keystroke.

Code undernetah could be an approach for Internet Explorer users, dealing with:
arrow left = go to previous page
arrow right = go to next page
arrow up= refresh page

Bart

<html>
<head>
<script language="JavaScript">
function myHandle()
{
// uncomment this to see the keycode of current key
// alert (event.keyCode);

if (event.keyCode=="37") { history.go(-1); }
if (event.keyCode=="38") { location.reload(); }
if (event.keyCode=="39") { history.go(+1); }
}
</script>
</head>
<body onLoad="self.focus(); document.body.onkeydown = myHandle;">
your webpage
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top