Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Macman1993

macrumors 6502
Original poster
Nov 23, 2007
337
16
Quick question, in JavaScript I know I can use OnMouseOver for mouse over events but is there the equivalent for not over?
 
As indicated, onmouseout is the opposite of onmouseover (note the capitalisation). However if this is for doing things like rollover effects on buttons then the CSS :hover pseudoclass may be preferable.

This is a somewhat grey area - you can do it via either method and the advocates of each would recommend their way - but it all depends on just what you want to happen when the mouse is moved on and off the element.

The big downside to the CSS method is that IE6 doesn't support :hover on anything but <a> elements - IE7 will only do so if your DOCTYPE is strict rather than transitional. The downside to Javascript is that the effect disappears if Javascript is turned off.
 
Great thanks guys, and out of curiosity what the hell was going through Microsoft's head when they made ie6? It seems like half the things around don't work with it and tons of server software I've used has to include ie6 fixes.
 
... and out of curiosity what the hell was going through Microsoft's head when they made ie6? It seems like half the things around don't work with it and tons of server software I've used has to include ie6 fixes.

This has been common knowledge for 9 years.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.