Topic: Can I assign a script to a CSS class? (Page 1 of 1) |
|
---|---|
Obsessive-Compulsive (I) Inmate From: |
![]() I want to assign a "OnMouseOver" to every object in a particular class. Can this be done? |
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() I don't really understand what you mean here. |
Paranoid (IV) Inmate From: France |
![]() Otherwise, Google & getElementsByClassName are your friends mate. |
Obsessive-Compulsive (I) Inmate From: |
![]() 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 |
![]() Yes, it can be done, using the DOM. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() 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 |
![]() The poster has demanded we remove all his contributions, less he takes legal action. |
Nervous Wreck (II) Inmate From: |
![]() 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 |
![]() quote:
|