I’m a newbie to javascript and im having a problem with an extremely simple script. It is supposed to be a simple image view so that when you click the next button it goes to the next image. It’s not working though and I’ve looked at it until im crosseyed. Can somebody help me out here?
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<script type=”text/javascript”>
var name=”xmas05″
var imgCount = 61
var pics[] = new Array(imgCount)
var start = null
var counter = 0
for(i = 1; i <= imgCount; i++)
{
pics[i] = new Image()
pics[i].src = name+”/pic”+i+”.jpg”
}
function changef()
{
counter ++
document.getElementById(“slide”).src = pics[counter].src
if(counter == imgCount)
counter = 0
}
}
function changeb()
{
counter —
document.getElementById(“slide”).src = pics[counter].src
if(counter == imgCount)
counter = 0
}
}
</script>
</head>
<body>
<img src=”../Graphics/backbutton.gif” width=”40″ height=”49″ border=”0″ onClick=”changeb()”>
<img src=”../Graphics/playbutton.gif” width=”40″ height=”49″ border=”0″ onClick=”changef()”>
<img src=”xmas05/pic1.jpg” id=”slide” />