Assining key to button script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • P K

    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
  • Bart Van der Donck

    #2
    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="JavaS cript">
    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.fo cus(); document.body.o nkeydown = myHandle;">
    your webpage
    </body>
    </html>

    Comment

    Working...