<SCRIPT language=JAVASCRIPT type=text/javascript>
<!--
/*Callout: Here the image objects are stored in an array.*/
var mySlides = new Array();
mySlides[1] = new Image();
mySlides[2] = new Image();
mySlides[3] = new Image();
mySlides[4] = new Image();
mySlides[5] = new Image();
mySlides[6] = new Image();
mySlides[7] = new Image();
mySlides[8] = new Image();
mySlides[9] = new Image();
mySlides[10] = new Image();


mySlides[1].src = "images/Brad.jpg";
mySlides[2].src = "images/Chayanne.jpg";
mySlides[3].src = "images/Ricky Martin.jpg";
mySlides[4].src = "images/Matthew Perry.jpg";
mySlides[5].src = "images/Antonio Banderas.jpg";
mySlides[6].src = "images/Cat.bmp";
mySlides[7].src = "images/Jim Cavaziel.jpg";
mySlides[8].src = "images/George C.bmp";
mySlides[9].src = "images/Josh.bmp";
mySlides[10].src = "images/Kitties.jpg";


/*Callout: The text captions are stored in another array.*/
var myCaptions = new Array();
myCaptions[1] = "Brad Pitt. ";
myCaptions[2] = "Puerto Rican Chayanne.";
myCaptions[3] = "The Cutest Thing-Ricky Martin.";
myCaptions[4] = "Matthew Perry from Friends.";
myCaptions[5] = "Antonio Banderas from Spain.";
myCaptions[6] = "Guess Who.";
myCaptions[7] = "Jim Cavaziel.";
myCaptions[8] = "Sexy Georgy Clooney.";
myCaptions[9] = "Josh H.";
myCaptions[10] = "Watching Lunch.";

var slidenumber = 1;
var totalslides = mySlides.length - 1;

var slidenumber = 1;
var totalslides = mySlides.length - 1;

function showSlide(direction){
    if (direction == "next"){
        (slidenumber == totalslides) ? slidenumber = 1 : slidenumber++;
    }
else{
        (slidenumber == 1) ? slidenumber = totalslides : slidenumber--; 
    }
    if (document.images){
        document.slideframe.src = mySlides[slidenumber].src;
        document.slidecontrols.caption.value = myCaptions[slidenumber];
        document.slidecontrols.currentslide.value = slidenumber;
    

}

function start(){
		myslides.src = mySlides[1];
		slidenumber = 1;

}
function end(){
		mySlides.src = mySlides(10)[mySlides(10).lenght-9];
		slidenumber = mySlides(10).length-9
}}

//-->
</SCRIPT>
</HEAD>
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY bgColor=white>
<DIV align=center>
<H2>Cute Things</H2><IMG height=290 
alt="Slide show images appear here." src="Images/Brad.jpg"
width=250 name=slideframe> 
<FORM name=slidecontrols>
<P><TEXTAREA name=caption cols=50>Our slide show begins with Brad.</TEXTAREA><BR><BR>
<INPUT onClick="showSlide('previous');" type=button value="Previous Slide"> 
<INPUT onClick="showSlide('next');" type=button value="Next Slide"><BR><BR>
Slide Number: <INPUT size=5 value=1 name=currentslide></P>

<INPUT onClick="start('start');" type=button value="First Slide"><BR><BR>
<INPUT onClick="end('end')" type=button value="Last Slide"><BR><BR>





</FORM></DIV></BODY></HTML>


<form action="mailto:rmaldonado508@pccc.mailcruiser.com"
method="POST" enctype="text/plain" name="survey"
onsubmit="return(slidenumber&& start()&& end());">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0065)[url]http://wps.aw.com/wps/media/objects/58/60015/code/listing5.1.html[/url] -->
<HTML><HEAD><TITLE>Slide Show</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

<SCRIPT language=JAVASCRIPT type=text/javascript>
<!--
/*Callout: Here the image objects are stored in an array.*/
var mySlides = new Array();
mySlides[1] = new Image();
mySlides[2] = new Image();
mySlides[3] = new Image();
mySlides[4] = new Image();
mySlides[5] = new Image();
mySlides[6] = new Image();
mySlides[7] = new Image();
mySlides[8] = new Image();
mySlides[9] = new Image();
mySlides[10] = new Image();


mySlides[1].src = "images/Brad.jpg";
mySlides[2].src = "images/Chayanne.jpg";
mySlides[3].src = "images/Ricky Martin.jpg";
mySlides[4].src = "images/Matthew Perry.jpg";
mySlides[5].src = "images/Antonio Banderas.jpg";
mySlides[6].src = "images/Cat.bmp";
mySlides[7].src = "images/Jim Cavaziel.jpg";
mySlides[8].src = "images/George C.bmp";
mySlides[9].src = "images/Josh.bmp";
mySlides[10].src = "images/Kitties.jpg";


/*Callout: The text captions are stored in another array.*/
var myCaptions = new Array();
myCaptions[1] = "Brad Pitt. ";
myCaptions[2] = "Puerto Rican Chayanne.";
myCaptions[3] = "The Cutest Thing-Ricky Martin.";
myCaptions[4] = "Matthew Perry from Friends.";
myCaptions[5] = "Antonio Banderas from Spain.";
myCaptions[6] = "Guess Who.";
myCaptions[7] = "Jim Cavaziel.";
myCaptions[8] = "Sexy Georgy Clooney.";
myCaptions[9] = "Josh H.";
myCaptions[10] = "Watching Lunch.";

var slidenumber = 1;
var totalslides = mySlides.length - 1;

var slidenumber = 1;
var totalslides = mySlides.length - 1;

function showSlide(direction){
    if (direction == "next"){
        (slidenumber == totalslides) ? slidenumber = 1 : slidenumber++;
    }
else{
        (slidenumber == 1) ? slidenumber = totalslides : slidenumber--; 
    }
    if (document.images){
        document.slideframe.src = mySlides[slidenumber].src;
        document.slidecontrols.caption.value = myCaptions[slidenumber];
        document.slidecontrols.currentslide.value = slidenumber;
    

}

function start(){
		myslides.src = mySlides[1];
		slidenumber = 1;

}
function end(){
		mySlides.src = mySlides(10)[mySlides(10).lenght-9];
		slidenumber = mySlides(10).length-9
}}

//-->
</SCRIPT>
</HEAD>
<BODY bgColor=white>
<DIV align=center>
<H2>Cute Things</H2><IMG height=290 
alt="Slide show images appear here." src="Images/Brad.jpg"
width=250 name=slideframe> 
<FORM name=slidecontrols>
<P><TEXTAREA name=caption cols=50>Our slide show begins with Brad.</TEXTAREA><BR><BR>
<INPUT onClick="showSlide('previous');" type=button value="Previous Slide"> 
<INPUT onClick="showSlide('next');" type=button value="Next Slide"><BR><BR>
Slide Number: <INPUT size=5 value=1 name=currentslide></P>

<INPUT onClick="start('start');" type=button value="First Slide"><BR><BR>
<INPUT onClick="end('end')" type=button value="Last Slide"><BR><BR>





</FORM></DIV></BODY></HTML>

Ah, debugging JavaScript is a mission at times. I highly recommend getting a debugger like firebug.

So I found a few issues in the code above. Firstly, you are calling "start('start')", you don't need any arguments for start (see the definition).

Second, there isn't actually a "start()" function in your JavaScript because the showSlide function isn't being closed at the right place (check your brackets).

Third, why are you using different code to show the first / last slides. For a start, it doesn't work and it won't reset your caption and counter.

Hope this helps, if you get stuck again, I'll give you some more pointers.

I replied to your other post, be a little more patient perhaps. If you annoy people, they won't help you out...

Sorry, I found two errors and I didn't know how to edit the first one. That is why I re-posted the same problem.

  1. Posts merged
  2. Use common sense and post updated code in existing thread instead of creating new one
  3. Would be nice if you started using code tags
This article has been dead for over six months. Start a new discussion instead.