Quote:
Originally Posted by alex90
still no slideshow,it just shows the source image that i set
|
Works OK for me. Check your attempt against this.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title> Untitled </title>
<style type="text/css">
#slideshow { margin: 50px 200px; }
</style>
</head>
<body>
<img id="slideshow">
<script type="text/javascript">
var baseURL = 'http://www.nova.edu/hpd/otm/pics/4fun/';
var result = ['11.jpg','12.jpg','13.jpg','14.jpg','15.jpg'];
var curimg = 0
function rotateimages(){
curimg=(curimg<result.length-1) ? curimg+1 : 0
document.getElementById("slideshow").setAttribute("src", baseURL+result[curimg])
}
window.onload=function(){
document.getElementById('slideshow').src = baseURL+result[curimg];
setInterval(rotateimages, 2500)
}
</script>
</body>
</html>
Note: I did not have access to your image directory, so I used mine.
Change the 'baseURL' and result array filenames for your version.