Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: onKeyPress, onKeyUp not working with <img> tag


Message #1 by quez_wood@y... on Wed, 25 Sep 2002 21:58:14
Hello all. My first post.

I have javascript event I am firing off via onClick and it works fine:

<IMG name="menuToggle" src="/eomis/images/big_minimize_hide.gif" 
title="Hide unavailable menu opitons" 
onClick="parent.toggleMenuInactiveOptions()">

Now, I want the above <IMG> tag to swap out the .gif file seen by the user 
when they click/press on the image to give the effect of an actual input 
type of button.

But when I change the above <IMG> tag to handle the two different events 
(onKeyPress and onKeyUp) neither works:

<IMG name="menuToggle" src="/eomis/images/big_minimize_hide.gif" 
title="Hide unavailable menu opitons" onKeyPress="parent.togglePressGif()" 
onKeyUp="parent.toggleMenuInactiveOptions()">

I already researched the net a little and everything that I have found 
says that the onKeyPress and onKeyUp are both valid event handlers for the 
<IMG> tag.

Please help. Thanks!

Marques


  Return to Index