hi to all,
js is not my native language
can someone help with the logic on the previous function pls
i think code explains itself, else let me know.
thanx all
gave you whole html so u can cut and paste if need be
kind regards,
g00fy
js is not my native language
can someone help with the logic on the previous function pls
i think code explains itself, else let me know.
thanx all
Code:
<html>
<head>
<title>Test Slideshow</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
var activeTimeout=false;
var halt = false;
var backward = false;
var delay = 3000; // image delay (millisec)
var transition = 0; // transition time (sec)
var imgObjects = new Array("about.gif", "album.gif", "about_over.gif") ;
var imageArray = new Array();
var a = 0;
var b;
for (i = 0; i < imgObjects.length; i++){
imageArray[i] = new Image();
imageArray[i].src = imgObjects[i];
}
function swapImage(){
b = document.images.SlideShow.src;
if(!halt){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=transition)";
document.images.SlideShow.filters.blendTrans.Apply() ;
}
if(!backward){
document.images.SlideShow.src = imageArray[a].src;
if (document.all){
document.images.SlideShow.filters.blendTrans.Play();
}
a = a + 1;
}else{
document.images.SlideShow.src = b;
if (document.all){
document.images.SlideShow.filters.blendTrans.Play();
}
backward = false;
}
if (a > (imgObjects.length-1))
a = 0;
activeTimeout = setTimeout("swapImage();activeTimeout=false", delay);
}
}
function next(){
halt = false;
if (activeTimeout)
clearTimeout(activeTimeout);
swapImage();
}
function previous(){
halt = false;
if (activeTimeout)
clearTimeout(activeTimeout);
backward = true;
swapImage();
}
function stopNow(){
halt = true;
document.images.SlideShow.src = document.images.SlideShow.src;
activeTimeout = false;
}
</script>
</head>
<body onload="swapImage()">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=150 width=150> <img src="about.gif" name='SlideShow' width=150 height=20></td>
</tr>
</table>
<input type="submit" name="prev" value="<< Previous" onClick="previous()">
<input type="submit" name="stop" value="Stop !" onClick="stopNow()">
<input type="submit" name="next" value="Next >>" onClick="next()">
</body>
</html>
gave you whole html so u can cut and paste if need be
kind regards,
g00fy