wakuwuaku
01-26-2009, 12:46 PM
Hi I have to use a simple javascript slideshow for a section of my coursework creating a website.
The site is contained in a folder called assignment1 with all of the websites pages and the javascript, there is also a folder in here called images.
my javascript is as follows.
var index=1;
function moveToNextSlide()
{
var img = document.getElementById("img1");
var slideName="Images/img" + index++ + ".jpg";
img.src=slideName;
}
moveToNextSlide();
// JavaScript Document
Then the following code is within my html
in my header is
<script type="text/javascript" src="………………."></script>
Then the follwoing is placed where i would like the slideshow to appear.
<p><img id="img1" src="" width="400" height="325"></p>
<p><a href="javascript:moveToNextSlide()">Next</a></p>
<script>
moveToNextSlide();
</script>
All the images are called img1.jpg, img2.jpg and so on. The slideshow is showing up but no images are appearing.
Does anyone see my problem?
Thanks oliver
The site is contained in a folder called assignment1 with all of the websites pages and the javascript, there is also a folder in here called images.
my javascript is as follows.
var index=1;
function moveToNextSlide()
{
var img = document.getElementById("img1");
var slideName="Images/img" + index++ + ".jpg";
img.src=slideName;
}
moveToNextSlide();
// JavaScript Document
Then the following code is within my html
in my header is
<script type="text/javascript" src="………………."></script>
Then the follwoing is placed where i would like the slideshow to appear.
<p><img id="img1" src="" width="400" height="325"></p>
<p><a href="javascript:moveToNextSlide()">Next</a></p>
<script>
moveToNextSlide();
</script>
All the images are called img1.jpg, img2.jpg and so on. The slideshow is showing up but no images are appearing.
Does anyone see my problem?
Thanks oliver