View Full Version : Help with a slideshow script
08-17-2004, 03:07 AM
What this script does, is when this function is called, it switches to another image. Now, what I need is the "alt" attribute of the images to do the same thing. Thanks for you time.
var thisPic = [0, 0, 0, 0, 0];
function chgSlide(change, direction)
thisPic[change] += direction;
imgCt = slideChoice[change].length -1;
if(thisPic[change] > imgCt)
thisPic[change] = 0;
if(thisPic[change] < 0)
thisPic[change] = imgCt;
document.getElementById(slideID[change]).src = slideChoice[change][thisPic[change]];
My website is here (http://ampulator.freeprohost.com/srwr.html).
08-17-2004, 03:16 AM
When providing example code it is always helpful to provide enough for a working example... In this case that would be the script, an image and the function call...
However, if I had to guess: thisPic[change].alt = 'My new alt'
Or: thisPic[change].setAttribute('alt','My new alt');
08-17-2004, 03:46 AM
Thanks for the info. I'm going to try this asap.
I did, provide an example, that used the function. But There was a lot of extra code that might not have been related to the function. :p
08-17-2004, 03:55 AM
Yea well, looking at it again your solution may be here:
But, as I previsously stated.... example code.....
08-17-2004, 04:36 AM
It's actually here. (http://ampulator.freeprohost.com/zgundam.html)
And here's some sample code:
// <![CDATA[ Use this code blcok for scripts put in the <head> section
var mechMethuss = ["methuss.gif", "methussma.gif"], mechZetagundam = ["zgundam.gif", "waverider.gif"], slideChoice = [mechMethuss, mechZetagundam], slideID = ["methuss", "zetagundam"];
// ]] -->
<p><img src="methuss.gif" alt="Methuss/Methuss Mobile Armor" id="methuss" />
<input type= "button" value= "Previous" onclick= "chgSlide(0, -1)" /><input type= "button" value= "Next" onclick= "chgSlide(0, 1)" />
<p><span class="bold">Methuss: </span>The Methuss was created under "Project Zeta" to test to the feasiblity of transformation systems. Its transformation systems gave it extra speed and agility in Mobile Armor form, and allowed earth atmospheric entry. The Methuss was considered successful, and its transformation systems was later put into Zeta Gundam. However, due to its original purpose, it was not designed for combat. However, it was easy to repair. It is regulated as an repair unit.</p>
<p><span class="bold">First Pilot: </span>Fa Yuiri</p>
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.