0

I already have 3 Javascripts working that I trigger within my <td>'s like this:

<td onMouseOver="mover(this)" onMouseOut="mout(this)" onClick="mclick('test.html')">Test Button</td>

I have now coded up 1 Javascript function to handle all 3 events (using if statements).

But how do I trigger the calling of that function inside my <td>'s? I was hoping there would be some kind of general “onEvent” but haven’t found one:

<td onEvent="mousebutton( this, event, 'test.html' )" >Test Button</td>

(I’m assuming this is an HTML question since my Javascript per se is working. But do please let me know if this would be more appropriate in another forum.)

Thanks!

2
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by RobRob666
0

where javascript is used, it is the initial script trappping the 3 events separately, more currently use css to change appearance on mouseover(css hover), javascsript is often disabled as a security issue
havent seen any generic onEvent handler except in tutorial pages where it is a teaching aid followed up with the list of possible events.
You could write a onevent handler, but it would add complexity and slow things down, rather than simplify and speed up

/* css for mouseover */

td { text-decoration:none; }
td:hover { background-color:#66cdaa; text-decoration:bold; }

its a pale turquoise color background, its awful , but it suits my layout

0

Okay! I see how that can work. Your method is much better than mine, and I will try it. (While I have been trying to put everything possible and reasonable into CSS, I had not realized the hover could be so customized.)

Thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.