...

View Full Version : Image Fade In/Out



uniquesole
12-28-2007, 02:27 PM
I want to make a image fade in on click of a link, for example like this:

http://www.wakeupmrsingh.com/

I found this script I could use:

http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

Then I found this js script I could use to fade in the image, but I don't know how to put the codes together:

http://clagnut.com/sandbox/imagefades/

How can I put the codes togther, and make a image fade in/out on click? Am I using the wrong codes?

HELP PLEASE!

Actinia
12-28-2007, 03:22 PM
The clagnut page uses the line
window.onload = function() {initImage()} so that the image begins to fade in as soon as your page is loaded. In your case, you would use the initImage() function as an event in your link code. Something like:
<a href="mylink" onclick="initImage();">Link text</a>

John

uniquesole
12-29-2007, 02:40 AM
Thanks alot for responding.

One question though; How do I put the clagnut codes together as a script?

Actinia
12-30-2007, 05:47 PM
Try the code here (http://www.actinia.me.uk/imageFades/testFadeIn.htm). Does this do what you want?

John

sybil6
12-31-2007, 12:11 PM
how can you make the same thing as clagnut but with an array of 3 images?

Actinia
12-31-2007, 03:59 PM
Do you mean you want:

an array of three images to be faded in together,

or one at a time,

or each image gets faded in when you click on an appropriate link,

or a single image placeholder, with the selected image fading in?

The first of these options would be more complex than the other three and would require re-writing the clagnut code.

John



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum