Forum Moderators: open
Anyway, I'm currently trying to make a replacement rollover code for multiple (about seven, not including their mouseover form) graphics. One that any professional website would use, with quick-loading preloaded images. I've searched all over the web and everyone keeps telling me to use a WYSIWYG editor like Dreamweaver. I even bought a book (perhaps some of you are familiar with it: Designing web graphics .4, by Lynda Weinman), and even it says the same thing! (By the way, I needed the book anyway, so I didn't waste my money.) Now, just using Dreamweaver would probably be all fine and dandy, if I had a ton of cash, but I don't. Plus, if I let DW do all the work, I won't learn anything.
So, please, would some experienced person walk me through this fancy rollover code? Your help would be more appreciated than you could possibly imagine.
Thank you.
~Mirella -- Whom is wanting to be a web designer someday, but is having much trouble teaching herself.
The article is titled "CODE: Peeling the Onion for a Simpler Understanding of DHTML". Note that the code in the article includes an instruction for onmouseout that shouldn't have been part of the article. The source on the sample page at the link listed in the article has the corrected code.
<script language="JavaScript">
<!--
// pre-cache all rollover images
var roimg1_out = new Image(85,35);
roimg1_out.src = "button1a.gif";
var roimg1_over = new Image(85,35);
roimg1_over.src = "button1b.gif";
//-->
</script>
This part goes in the <body> area:
<img src="button1a.gif" width="85" height="35" border="0"
onMouseOut="this.src = roimg1_out.src"
onMouseOver="this.src = roimg1_over.src">
Obviously, you'll have to change the file sizes and file names.