I have this perfect slideshow set up thanks to Toicontien. I was wondering if anyone could help me fade the images between slides. Is something that can be done with my code? Thanks for your time.
interval : 3,
timer : null,
addImage : function(src)
{
return this.images.push( this.createImage(src) ) – 1;
},
change : function()
{
this.currentImage = this.getNextImage();
this.getImage().src = this.images[ this.currentImage ].src;
},
createImage : function(src)
{
var img = document.createElement(“img”);
img.src = src;
return img;
},
destroy : function()
{
this.stop();
this.images = null;
},
getImage : function()
{
return document.getElementById(this.id);
},
getNextImage : function()
{
var i = this.currentImage + 1;
if (i == this.images.length) {
i = 0;
}
return i;
},
start : function()
{
if (this.timer) {
return;
}
this.timer = setInterval(this.change.bind(this), this.interval * 1000);
},
stop : function()
{
if (!this.timer) {
return;
}
clearInterval(this.timer);
this.timer = null;
}
};
<script type=”text/javascript”>
<!–
var img = new ImageSwitcher(“logos_slide”);
img.addImage(“images/logos_slide.jpg”);
img.addImage(“images/logos_slide2.jpg”);
img.start();
// –>
</script>