Tech-Essen
Mitglied
Hallo,
kann mir bitte mal jemand sagen, wie man eine Slideshow erstellt, die automatisch und manull zu steuern ist?
So wird das Bild dann sofort durch "setTimeout("slide()",1000)" nach dem manuellen Eingriff wieder geändert. Wie kann man das unterbinden?
kann mir bitte mal jemand sagen, wie man eine Slideshow erstellt, die automatisch und manull zu steuern ist?
HTML:
<html>
<head>
<script>
var index = 2
function slide()
{
index++
document.getElementById("box").src=index + ".png"
if(index > 3)
index = 1
setTimeout("slide()",1000)
}
</script>
</head>
<body onload = "slide()">
<img src="1.png" id="box" width="640" height = "400"></img>
<input type="submit" value="<-" onclick="index--; document.getElementById('box').src=index + '.png'"></input>
<input type="submit" value="->" onclick="index++; document.getElementById('box').src=index + '.png'"></input>
</body>
</html>