Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

join onmouseout and onmouseover together

Status
Not open for further replies.

NateBro

Programmer
Sep 1, 2004
233
US
ok, i know this can be done, i had the code before but i lost it somehow :(

its something like
Code:
onmouseout:onmouseover="alert();"

some how you can like the to events into one.
any help on this would be great!

thanks! :D
~Nate_Bro
 
You can't combine events - you simply have to call the same function for each if you want the same functionality, e.g:

Code:
onmouseover="someFunc(params);" onmouseout="someFunc(params);"

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hmmmm, now i really need to find that script i used before, it really worked! :)
 
Have you tried something like this...

Code:
mycontrol.onmouseout = MyEventHandler();
mycontrol.onmouseover = mycontrol.onmouseout;

Should at least work if you're adding event handling using DOM...
 
I haven't tested it, but something like this should work. It has to be done as javascript, not as an attribute of the control tag itself.
Code:
mycontrol.onmouseover = mycontrol.onmouseout = myEventHandler;

Note that you do NOT use parens after the event handler name. If you do, the event handler will be called right away (it is a function call) and it's return value will be assigned as the event handler for the control. Not normally what you want.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top