user837433 user837433 - 1 year ago 115
HTML Question

mouse events with buttons: mouseover, onclick, static

I'd like a button to have 3 different states (3 different images of the same button)
-release (back to static)

I've found plenty of examples of mouseover chaning the image, but nothing with the click option.

Thanks :)

Answer Source

High-level answer: use the CSS1 :active pseudo-class.

#myButton {
    /* static state */

#myButton:hover {
    /* hover state */

#myButton:active {
    /* state while clicked but not released */
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download