The OnMouseOver Event These are your greatests friends when it comes to dynamic content. They allow pages to 'react' when a user runs a mouse over and off an object. Primarily used for 'image switching', these two event handlers can do everything. First, let's look at where these go. For the most part, any object can contain these two event handlers. Here, let's do the dreaded
onMouseOver image switching. To start, we need to do a little planning. We need a function to do our image switching, yet we don't want to write a function for every switch we want to do. From experience, the easiest way we've found to do this is to pass in paramaters that will cover the name, file, and object of what we are trying to switch. Let's take a look at an example page.
KeepVar = Name;
SwitchImg = Name + "_on.gif";
SwitchImg = KeepVar + "_off.gif";
<A HREF="." onMouseOver="ChangePicture('one')" onMouseOut="Fix()"<>IMG SRC="one_off.gif" NAME="one" BORDER=0></A>
<A HREF="." onMouseOver="ChangePicture('two')" onMouseOut="Fix()"><IMG SRC="two_off.gif" NAME="two" BORDER=0></A>