Ooops, it worked with 4 images so, I just assumed . . . Often the worst thing to do. Anyways, I had in it the back of my mind that this might not work with all the possible number of images. You've brought that to the front. To make a long story short, the counter number used by the carousel is not a reliable indicator for the actual image showing (it relates to an image's position in the visible part of the carousel) so, we will have to test for the image itself. I've updated the demo, so you can take the code from there as before:
http://home.comcast.net/~jscheuer1/side/c_fade/
Make sure to refresh your browser if it isn't now showing 5 images. Configuration for carousel is still as it was but, the script code has been updated yet again, the AnimatedFader.js external file is still unaltered. I think I will also detail the 2nd script for Textual tooltip II (fade into view) as I did before, so you can better understand its new workings (new changes/additions red):
Code:
<script type="text/javascript">
if (document.layers){
document.write('<ilayer name="nscontainer" width="100%" height="100">')
document.write('<layer name="fade1" width="100%" height="100">')
document.write('</layer></ilayer>')
}
else
document.write('<DIV ID="fade1"></DIV>')
/////////////added for carousel fade tip:
function fadeLoad(el){
var texts=new Array()
texts[0]=['photo1.jpg', '<FONT SIZE=4 FACE=Verdana>Visit WA for comprehensive JavaScript tutorials and over 400+ free scripts!</FONT>', 'ff0000'];
texts[1]=['photo2.jpg', '<FONT SIZE=4 FACE=Verdana>Click here for direct link to hundreds of free Java resources online</FONT>', 'ff0000'];
texts[2]=['photo3.jpg', '<FONT SIZE=4 FACE=Verdana>The premier DHTML site online!</FONT>', 'ff0000'];
texts[3]=['photo4.jpg', 'Some other text', 'ff0000'];
texts[4]=['photo5.jpg', 'Some other text for image 5', 'ff0000'];
for (var i_tem = 0; i_tem < texts.length; i_tem++)
if(el.src.indexOf(texts[i_tem][0])>-1){
fade_up('fade1', texts[i_tem][1], texts[i_tem][2]);
break;
}
}
</script>
I think you can see what the idea is, we now are checking to see which image is displayed, and displaying the text based upon that information. You only need the image name here, the path is not required and probably shouldn't be used.
To answer your second question, the background or blend color for Textual tooltip II is set here:
Code:
<script type="text/javascript">
//Script submitted to and featured on
//http://www.dynamicdrive.com
/*
* FadingText(divName, numSteps, BGColor)
* divName : Must match the DIV names defined at the end of the BODY)
* numSteps: The number of steps in the fading transition
* BGColor : The background colour of the DIV or document.
*/
FadingText('fade1', 10,"000080");
/*** The "Frame Interval" Smaller = faster ***/
FadeInterval=30;
</script>
Hex values (without the customary hash mark '#') must be used, 000080 is hex for navy.
Bookmarks