Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: Re: Jason Nugent please help. One last thing re:my rollovers - September 08, 1998 at 05:40:03

You are here: irt.org | BBS | Re: Jason Nugent please help. One last thing re:my rollovers [This BBS is closed]

Posted by Jason Nugent on September 08, 1998 at 05:40:03:

In Reply to: Re: Jason Nugent please help. One last thing re:my rollovers posted by Darren Perara on September 07, 1998 at 23:20:39:


*sigh* :)

Ok. Well, with the code you specified, any group of images now begins with your default image. So... if you have something like this:

<A HREF="index.html" onMouseOver="fadeIn ('left');return true"
onMouseOut="fadeOut ('left');return true"><IMG SRC="default.gif" NAME="left"></A>

the image will start off with default.gif. It has the unique name 'left', and the functions know what to use as the other images because it takes the name you pass to it (left, in this case), and concatenate either 1.src, 2.src, 3.src, or 4.src to the end of it to get the different srcs.
The name is common to all four because each image in the series has it as its base (left, for example... becomes left1.src for the first image, and left2.src for the second image, and so on).
About getting rid of the names. In this case, I would probably advise you to stick with them for now. Remember, though, that JavaScript keeps track of things on your page in arrays. There is a single array that lists every image used on your page, in order. For example, document.images[0] will point to the FIRST image on your page. document.images[1] will point to the second one. In this manner, you can refer to items without having to use a NAME attribute. HTML 4 doesn't support the NAME attribute of the IMG tag, so if you want your code to be HTML 4 compliant you need to use this instead.

Jason


Follow-ups:

You are here: irt.org | BBS | Re: Jason Nugent please help. One last thing re:my rollovers [This BBS is closed]

©2018 Martin Webb