Miscellaneous Codes/Scripts

This section is contains miscellaneous codes and scripts that are a little more complex than those in the code dictionary.

JavaScript Rollover Code

For a good example, go to http://www.alleycatscratch.com/lotr/ and hold your cursor over the buttons on the left. See how they change? That's what a "rollover" effect is. This is one code you can use:
<a href="index.html" onmouseover="image1.src='image2.jpg';" onmouseout="image1.src='image.jpg';"> <img name="image1" src="image.jpg" border=0></a>
How does it all work? First, the "index.html" is the URL of the link. All three "image1"s are for reference; you can change this to anything you want, but if you use the code multiple times, make sure each code has a different reference word. The "image2.jpg" is the URL of the image you want to flash when viewers hold their cursor over the original image. "image.jpg" (both of them) is the URL of the original image.

Add to Favorites Button

<FORM> <INPUT TYPE="button" VALUE="Add To Favorites" onClick='window.external.AddFavorite(location.href, document.title);'> </FORM>
And here's what it looks like:


You can change value="Add to Favorites" to whatever you want the button to say.