seloh77
05-02-2007, 01:54 PM
Preloaded Slide Show Script
http://www.dynamicdrive.com/dynamicindex14/preloadslide.htm
I want to modify the script so that is loops through all the pictures. I mean when it comes at the last picture in the array and you click the next-button it goes to the first picture in the array and when you're at the first picture of the array and you click the previous-button it goes to the last picture in the array.
I tried a modification myself that worked for the next-button at the last picture but completely disabled the previous-button.
Now I've made this modification to the ShowSlide function that works for the next-button at the last picture and doesn't disable the previous-button but it still does not work for the previous-button at the first picture:
if ((NextSlide >= 0) && (NextSlide < Slides.length))
{
document.images['Screen'].src = Slides[NextSlide].src;
CurrentSlide = NextSlide++;
Message = 'Picture ' + (CurrentSlide+1) + ' of ' + Slides.length;
self.defaultStatus = Message;
if (Direction == 1) CacheNextSlide();
}
else if (NextSlide == Slides.length)
{
document.images['Screen'].src = Slides[0].src;
CurrentSlide = 0;
}
Any help, ideas and/or suggestions would be appreciated.
Thanks in advance!
seloh
http://www.dynamicdrive.com/dynamicindex14/preloadslide.htm
I want to modify the script so that is loops through all the pictures. I mean when it comes at the last picture in the array and you click the next-button it goes to the first picture in the array and when you're at the first picture of the array and you click the previous-button it goes to the last picture in the array.
I tried a modification myself that worked for the next-button at the last picture but completely disabled the previous-button.
Now I've made this modification to the ShowSlide function that works for the next-button at the last picture and doesn't disable the previous-button but it still does not work for the previous-button at the first picture:
if ((NextSlide >= 0) && (NextSlide < Slides.length))
{
document.images['Screen'].src = Slides[NextSlide].src;
CurrentSlide = NextSlide++;
Message = 'Picture ' + (CurrentSlide+1) + ' of ' + Slides.length;
self.defaultStatus = Message;
if (Direction == 1) CacheNextSlide();
}
else if (NextSlide == Slides.length)
{
document.images['Screen'].src = Slides[0].src;
CurrentSlide = 0;
}
Any help, ideas and/or suggestions would be appreciated.
Thanks in advance!
seloh