You are here: irt.org | BBS | Re: Jason Nugent please help. One last thing re:my rollovers [This BBS is closed]
Posted by Darren Perara on September 08, 1998 at 18:29:41:
In Reply to: Re: Jason Nugent please help. One last thing re:my rollovers posted by Jason Nugent on September 08, 1998 at 05:40:03:
:
: *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
Jason,
I completely understand what you are saying, but its not what I'm after. I'll try to explain my exact purpose, so that you can visualise what I'm talking about. Imagine this layout of images:
You have a rectangular image of a girls head looking straight at you (default.gif). To either side, above and below this girls head there are images of arrows (larrow.gif, rarrow.gif, farrow.gif, barrow.gif) which correspond to movement in a particular direction. The girl is required to act as a navigator. When you roll over the left arrow the central head turns to the left, when you roll over the right arrow the head turns to the right and so on. This one head is common to all four actions, and is only placed in the document once, at the centre of the four arrows. The problem is, in the HTML the image source needs to be one of the arrows, but the rollover function needs to occur on the common and central head. So the image source in each case cannot be default.gif because it needs to be larrow.gif, rarrow.gif, farrow.gif or barrow.gif. How can this problem be overcome? Does some sort of definition for the default image need to occur in the head of the document? I don't have a clue.
Ta,
Darren.
Follow-ups:
You are here: irt.org | BBS | Re: Jason Nugent please help. One last thing re:my rollovers [This BBS is closed]