Topic: Can I assign a script to a CSS class? |
|
---|---|
Author | Thread |
Obsessive-Compulsive (I) Inmate From: |
posted 05-25-2004 06:28
I want to assign a "OnMouseOver" to every object in a particular class. Can this be done? |
Paranoid (IV) Inmate From: Sthlm, Sweden |
posted 05-25-2004 10:50
I don't really understand what you mean here. |
Paranoid (IV) Inmate From: France |
posted 05-25-2004 12:10
Otherwise, Google & getElementsByClassName are your friends mate. |
Obsessive-Compulsive (I) Inmate From: |
posted 05-25-2004 17:40
Well I'm not sure what example I can give, but basically I want to have a class that has a script attached to it, so any object assigned that class will perform the script on mouseover or by clicking it. |
Paranoid (IV) Inmate From: France |
posted 05-25-2004 18:18
Yes, it can be done, using the DOM. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 05-25-2004 18:22
If you want to modify the CSS when a mouse moves over an object you will need to make use of the :hover selector. |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
posted 05-25-2004 18:29
The poster has demanded we remove all his contributions, less he takes legal action. |
Nervous Wreck (II) Inmate From: |
posted 05-28-2004 09:21
Well I figured this out by pure luck/coincidence. I was looking on a way to make a css hover that would work in IE, as IE only seems to accept hovers on links. |
Paranoid (IV) Inmate From: France |
posted 05-28-2004 11:50
quote:
|