PDA

View Full Version : I have a question, not specifically related to Dynamic Drive



nadzD
01-07-2005, 12:45 AM
I am trying to use a JavaScript from http://mcfedries.com/JavaScript/ImageCycler.asp
I read the instructions and tried to use the script but i am quite obviously doing something wrong! This is what i have got so far:

<html>
<head>
</head>

<SCRIPT LANGUAGE="JavaScript">
<!--
// Use the following variable to specify
// the number of images
var NumberOfImages = 14
var img = new Array(14)
// Use the following variables to specify the image names:
img[0] = "http://friendpages.com/pages/movies/nadzamberbenson/photo1.jpg"
img[1] = "http://friendpages.com/pages/movies/nadzamberbenson/photo2.jpg"
img[2] = "http://friendpages.com/pages/movies/nadzamberbenson/photo3.jpg"
img[3] = "http://friendpages.com/pages/movies/nadzamberbenson/photo4.jpg"
img[4] = "http://friendpages.com/pages/movies/nadzamberbenson/photo5.jpg"
img[5] = "http://friendpages.com/pages/movies/nadzamberbenson/photo6.jpg"
img[6] = "http://friendpages.com/pages/movies/nadzamberbenson/photo7.jpg"
img[7] = "http://friendpages.com/pages/movies/nadzamberbenson/photo8.jpg"
img[8] = "http://friendpages.com/pages/movies/nadzamberbenson/photo9.jpg"
img[9] = "http://friendpages.com/pages/movies/nadzamberbenson/photo10.jpg"
img[10] ="http://friendpages.com/pages/movies/nadzamberbenson/photo11.jpg"
img[11] ="http://friendpages.com/pages/movies/nadzamberbenson/photo12.jpg"
img[12] ="http://friendpages.com/pages/movies/nadzamberbenson/photo13.jpg"
img[13] ="http://friendpages.com/pages/movies/nadzamberbenson/photo14.jpg"
img[14] ="http://friendpages.com/pages/movies/nadzamberbenson/photo15.jpg"
var imgNumber = 0
function NextImage()
{
imgNumber++
if (imgNumber == NumberOfImages)
imgNumber = 0
document.images["VCRImage"].src = img[imgNumber]
}
function PreviousImage()
{
imgNumber--
if (imgNumber < 0)
imgNumber = NumberOfImages - 1
document.images["VCRImage"].src = img[imgNumber]
}
//-->
</SCRIPT>

<IMG SRC="http://friendpages.com/pages/movies/nadzamberbenson/photo1.jpg" NAME="VCRImage">
<br>
<A HREF="javascript:PreviousImage()">
<IMG SRC="http://mcfedries.com/JavaScript/reverse.gif" BORDER=0></A>
<A HREF="javascript:NextImage()">
<IMG SRC="http://mcfedries.com/JavaScript/forward.gif" BORDER=0></A>

<body>
</body>
</html>

If you have a spare moment, could you please tell me what i am doing wrong and what the correct html would be, thankyou,
Nadine

Minos
01-07-2005, 04:14 AM
First, put a title in your <head> tags



<head>
<title>My Web Page</title>
</head>


Second, make sure everything (starting with <script>, ending with </script>) is put between the <head></head>

Third, put what's left (the images and junk) inside the <body> tags.



<body>
<IMG SRC="http://friendpages.com/pages/movies/nadzamberbenson/photo1.jpg" NAME="VCRImage">
<br>
<A HREF="javascript:PreviousImage()">
<IMG SRC="http://mcfedries.com/JavaScript/reverse.gif" BORDER=0></A>
<A HREF="javascript:NextImage()">
<IMG SRC="http://mcfedries.com/JavaScript/forward.gif" BORDER=0></A>
</body>