Hello,
I've use the code below, supplied by Trollacious, and it has worked well for me, but I was wondering if there's a way to adapt it to have dissolves between slides. Or a different approach that would accomplish that goal.
Thanks!
Bill
___________________________________________________________
<form><input type="button" value="<- Back" onclick="clearInterval(slideshow); clickphoto(-1);"> <input type="button" value="Resume Slideshow" onclick="slideshow=setInterval('swapimage()', 10000);"> <input type="button" value="Next ->" onclick="clearInterval(slideshow); clickphoto(1);"></form>
<div id="caption" style="font-family:arial; font-size:13;"></div><br>
<img name="photo">
<script language="javascript">
function clickphoto(direction)
{
pi += direction;
pi %= photo.length;
if (pi ==-1) pi = photo.length - 1;
displayphoto(pi);
}
function swapimage()
{
pi++;
pi %= photo.length;
displayphoto(pi);
}
function displayphoto(photonum)
{
document.images['photo'].src=photo[photonum].name;
caption.innerHTML=(photonum + 1) + ' of ' + photo.length + '<br> ';
if (photo[photonum].caption.length > 0)
{
caption.innerHTML+='<b>' + photo[photonum].caption + '</b>';
}
caption.innerHTML+=' ';
}
function Photo(name, caption)
{
this.name=name;
this.caption=caption;
return this;
}
var photo=new Array(), pi=0;
photo[pi++]=new Photo('photoname1','Caption1');
photo[pi++]=new Photo('photoname2','Caption2');
photo[pi++]=new Photo('photoname3','Caption3');
pi=0;
var caption=document.getElementById('caption');
displayphoto(pi);
var images=new Array();
for (var ii=0;ii<photo.length;ii++)
{
images[ii]=new Image();
images[ii].src=photo[ii].name;
}
var slideshow=setInterval('swapimage()', 10000);
</script>
I've use the code below, supplied by Trollacious, and it has worked well for me, but I was wondering if there's a way to adapt it to have dissolves between slides. Or a different approach that would accomplish that goal.
Thanks!
Bill
___________________________________________________________
<form><input type="button" value="<- Back" onclick="clearInterval(slideshow); clickphoto(-1);"> <input type="button" value="Resume Slideshow" onclick="slideshow=setInterval('swapimage()', 10000);"> <input type="button" value="Next ->" onclick="clearInterval(slideshow); clickphoto(1);"></form>
<div id="caption" style="font-family:arial; font-size:13;"></div><br>
<img name="photo">
<script language="javascript">
function clickphoto(direction)
{
pi += direction;
pi %= photo.length;
if (pi ==-1) pi = photo.length - 1;
displayphoto(pi);
}
function swapimage()
{
pi++;
pi %= photo.length;
displayphoto(pi);
}
function displayphoto(photonum)
{
document.images['photo'].src=photo[photonum].name;
caption.innerHTML=(photonum + 1) + ' of ' + photo.length + '<br> ';
if (photo[photonum].caption.length > 0)
{
caption.innerHTML+='<b>' + photo[photonum].caption + '</b>';
}
caption.innerHTML+=' ';
}
function Photo(name, caption)
{
this.name=name;
this.caption=caption;
return this;
}
var photo=new Array(), pi=0;
photo[pi++]=new Photo('photoname1','Caption1');
photo[pi++]=new Photo('photoname2','Caption2');
photo[pi++]=new Photo('photoname3','Caption3');
pi=0;
var caption=document.getElementById('caption');
displayphoto(pi);
var images=new Array();
for (var ii=0;ii<photo.length;ii++)
{
images[ii]=new Image();
images[ii].src=photo[ii].name;
}
var slideshow=setInterval('swapimage()', 10000);
</script>