Connecting Tech Pros Worldwide Help | Site Map

Assining key to button script

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 11:24 AM
P K
Guest
 
Posts: n/a
Default Assining key to button script

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

  #2  
Old July 23rd, 2005, 11:25 AM
Bart Van der Donck
Guest
 
Posts: n/a
Default Re: Assining key to button script

P K wrote:
[color=blue]
> 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?[/color]

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>
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.