/    Sign up×
Community /Pin to ProfileBookmark

This is the first time for me to get on a Forum and ask questions, so please be patient. I have a website and am trying to do a slideshow using Javascript…Finally found a code that I thought was simple enough for me to just copy and paste my JPEG info into it. However, after putting in 3 or 4 photos, I can’t get it to work any longer by adding any more photos to it. Could someone please help me with a simple code? Sorry but at my age, it’s rather hard for me to understand all the new computer stuff. Thanks!

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@balloonbuffoonApr 23.2006 — What do you currently have?

--Steve
Copy linkTweet thisAlerts:
@BytesApr 23.2006 — We will need to have a peek at the code you're using, to be of best help to you and your slide show.

Thanks,
Copy linkTweet thisAlerts:
@hoffmanstoysauthorApr 23.2006 — Sorry....that might help! Here it is...

<script language="JavaScript1.1">

<!--

/*

JavaScript Image slideshow:

By JavaScript Kit (www.javascriptkit.com)

Over 200+ free JavaScript here!

*
/

var slideimages=new Array()

var slidelinks=new Array()

function slideshowimages(){

for (i=0;i<slideshowimages.arguments.length;i++){

slideimages[i]=new Image()

slideimages[i].src=slideshowimages.arguments[i]

}

}



function slideshowlinks(){

for (i=0;i<slideshowlinks.arguments.length;i++)

slidelinks[i]=slideshowlinks.arguments[i]

}



function gotoshow(){

if (!window.winslide||winslide.closed)

winslide=window.open(slidelinks[whichlink])

else

winslide.location=slidelinks[whichlink]

winslide.focus()

}



//-->

</script>



<a href="javascript:gotoshow()"><img src="food1.jpg" name="slide" border=0 width=250 height=250></a>

<script>

<!--



//configure the paths of the images, plus corresponding target links

slideshowimages("jassismbrnmale2wks.jpg","jassismbrnmale2wks1.jpg","jassismbrnmale2wks2.jpg","jassismbrnmale2wks3.jpg","jassismlbrnmale4.5wks.jpg","jassismlbrnmale4.5wks2.jpg","jassismlbrnmale4.5wks3.jpg","jassismlbrnmale4.5wks5.jpg")



//configure the speed of the slideshow, in miliseconds

var slideshowspeed=2200



var whichlink=0

var whichimage=0

function slideit(){

if (!document.images)

return

document.images.slide.src=slideimages[whichimage].src

whichlink=whichimage

if (whichimage<slideimages.length-1)

whichimage++

else

whichimage=0

setTimeout("slideit()",slideshowspeed)

}

slideit()



//-->

</script>
Copy linkTweet thisAlerts:
@BytesApr 23.2006 — I&#8217;m going to suggest you perhaps consider the following script for a slide show instead of attempting to fix your present effort.

Place the following in the <HEAD> of your document:

[CODE]<script type="text/javascript">

var group1 = [];
group1[0] = "PopUps/driftwoodstand-100_1413.jpg";
group1[1] = "PopUps/driftwoodstand-100_1413.jpg";
group1[2] = "PopUps/driftwoodstand-100_1414.jpg";
group1[3] = "PopUps/driftwoodstand-100_1415.jpg";
group1[4] = "PopUps/driftwoodstand-100_1413.jpg";
group1[5] = "PopUps/driftwoodstand-100_1413.jpg";
group1[6] = "PopUps/driftwoodstand-100_1414.jpg";
group1[7] = "PopUps/driftwoodstand-100_1415.jpg";
group1[8] = "PopUps/driftwoodstand-100_1414.jpg";
group1[9] = "PopUps/driftwoodstand-100_1415.jpg";

var textCaption = [];
textCaption[0]= "Drift Wood Mounted on a Stand 1413";
textCaption[1]= "Drift Wood Mounted on a Stand 1413";
textCaption[2]= "Drift Wood Mounted on a Stand 1414";
textCaption[3]= "Drift Wood Mounted on a Stand 1415";
textCaption[4]= "Drift Wood Mounted on a Stand 1413";
textCaption[5]= "Drift Wood Mounted on a Stand 1413";
textCaption[6]= "Drift Wood Mounted on a Stand 1414";
textCaption[7]= "Drift Wood Mounted on a Stand 1415";
textCaption[8]= "Drift Wood Mounted on a Stand 1413";
textCaption[9]= "Drift Wood Mounted on a Stand 1414";

var rotate_delay = 3000; // delay in milliseconds (5000 = 5 secs)
var current = 0;
var caption = "";

function next(){
if (current < group1.length-1)
{
current++;
}
else {
current = 0;
}
document.images.show.src = group1[current]
caption.innerHTML = textCaption[current];
}

function gal1() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
caption.innerHTML = current;
}

function previous(){
if (current > 0)
{
current--;
}
else {
current = group1.length-1;
}
document.images.show.src = group1[current];
caption.innerHTML = textCaption[current];
}

function ap(text) {
document.forms[0].slidebutton.value = (text == "Stop") ? "AutoPlay" : "Stop";
rotate();
}

function rotate(){
if (document.forms[0].slidebutton.value == "Stop")
{
current = (current == group1.length-1) ? 0 : current+1;
document.images.show.src = group1[current];
caption.innerHTML = textCaption[current];
setTimeout("rotate()", rotate_delay);
}
}

function init(){
caption = document.getElementById('description');
caption.innerHTML = textCaption[0];
}

onload=init;

</script> [/CODE]
Edit:
[CODE]group1[0] = "PopUps/driftwoodstand-100_1413.jpg";[/CODE]and
[CODE]textCaption[0]= "Drift Wood Mounted on a Stand 1413";[/CODE] to reflect your own photos. I've listed 10 photos within the script, but you can add more by appending to these two aforementioned groups of code.

Add to following to the <BODY> of your document:

[CODE]<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="center" valign="middle">

<form name="slideform" style="margin: 0px">

<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td align="center" valign="middle">

<TABLE cellpadding="0" cellspacing="0" border="1" bordercolor="#1F3564" style="border-collapse: collapse">
<tr>
<td><img src="PopUps/driftwoodstand-100_1413.jpg" name="show">
</td>
</tr>
<tr>
<td style="font-size:10pt;color:darkblue;background-color:#808080;padding:5px" align="middle" id="description">&nbsp;
</td>
</tr>
</table>

<br>

<!-- START THE SLIDESHOW BUTTONS -->

<input type=button value="Close" onClick='self.close()' class="button-popups" onmouseover="this.className='buttonon-popups'" onmouseout="this.className='button-popups'">
<input type=button name="slidebutton" onClick="ap(this.value);" value="AutoPlay" title="AutoPlay" class="button-popups" onmouseover="this.className='buttonon-popups'" onmouseout="this.className='button-popups'">
<input type=button onClick="previous();" value="<<" title="Previous" class="button-popups" onmouseover="this.className='buttonon-popups'" onmouseout="this.className='button-popups'">
<input type=button onClick="next();" value=">>" title="Next" class="button-popups" onmouseover="this.className='buttonon-popups'" onmouseout="this.className='button-popups'">
</td>
</tr>
</table>
</form>[/CODE]
Revise the following code (within your <BODY> section) to reflect what photo you would like your slide show to start with:

[CODE]<img src="PopUps/driftwoodstand-100_1413.jpg" name="show">[/CODE]To keep things [B]Fair[/B], this script was presented to me by a member of this forum in an earlier posting.

Take Care,
Copy linkTweet thisAlerts:
@hoffmanstoysauthorApr 23.2006 — Wanted to say thanks for your help early this morning. This code did work for me on a couple of slideshows on the same page but when I went to do the third one, it never would work. Is there a problem where you can only put one or two shows on a page? Here is the URL to check what I was wanting to use it for. Any other suggestions would be greatly appreciated....

http://www.hoffmanstoys.com/nurserypgC.html
×

Success!

Help @hoffmanstoys spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...