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

BBS: Re: How do you fade a series of images in/out at a different location2 - August 27, 1998 at 09:39:31

You are here: irt.org | BBS | Re: How do you fade a series of images in/out at a different location2 [This BBS is closed]

Posted by Jason Nugent on August 27, 1998 at 09:39:31:

In Reply to: How do you fade a series of images in/out at a different location2 posted by Darren Perara on August 26, 1998 at 20:06:26:

: This message is to Jason Nugent, who replied to my last query. However, I am very new to the language of Javascript, and can't really work out what you're talking about. Please give me a solution in the simplest terms possible, ie. where the adjustments need to be made, maybe an example? Thanks for any help you can provide.

Ok... I won't go into the whole thing (you learn best by doing and experimenting :), but I'll try to set you on the right track.

The first thing that you have to do is define the src for your images in the top portion of the document. Two lines of code per image:

imageName1 = new Image ();
imageName1.src = "images/imageName1.gif"; // or whatever

do this for each image you want to swap.

the function is essentially the same:

function (imgName){

yada yada yada...

}

to flip an image, you have to change the src of the image. Straightforward, yes?

document[imgName].src = eval (imgName + "_on.src");

for instance... the new image src becomes imgName_on.src,
where imgName is replaced by the image name you passed into the function.

Typically, the function is called through a mouseOver.

onMouseOver="rollIn ('myImageName');return true;"

where myImageName is the name of the image present in the hyperlink and is the value given in the NAME attribute of the image. Usually, the imgName of the image being "rolled over" is the name of the image passed to the function. In your case, you want something different - the name of a different image somewhere else on the page. As long as you have defined the NAME attribute of the image, you can alter it from any event on the page, including roll overs on other images.

That's pretty much it. I would suggest inhaling the various image articles on IRT. We've beaten this topic pretty much to death.

Jason
Follow-ups:

You are here: irt.org | BBS | Re: How do you fade a series of images in/out at a different location2 [This BBS is closed]

©2018 Martin Webb