Downloaded and tried the new slideshow.php and it works very nicely and fast!
The only thing that took me a little work (just a little ), is that at first I couldn't get the filename/title beneath the images instead of above.
At first I did it by moving
echo "".$image->getTitle()." (".$count."/".$numberofimages.")";
to the end of the if/else statements (movie or mp3 or image) like I did in the 'old' slideshow.php file. This resulted in a correct presentation of that filename for two slides, but with the third slide this filename moved to a position above the image. This is because from then on this title/filename is created somewhat differently ('htmlblock +=' etc.), so I had to change it there to.
Thanks dpeterson and acrylian! This will limit the data transfer immensily for large albums .
Here's how we got around the issue of preloading images:
We used setInterval to call a function iteratively every 1 second to check if all the images have loaded (note: startingSlide attribute is required to restart cycle after it has been stopped):
var vCycleImages = setInterval("setImgCycleStatus()", 1000);
$(function() {
$('#fadeCenter').cycle();
$('#fadeCenter').cycle('stop');
});
function setImgCycleStatus() {
if ($.preloadImages("pic1", "pic2", "pic3", "pic4")){
$('#fadeCenter').cycle({
speed: 500,
timeout: 8000,
delay: -5000,
startingSlide: 0
});
clearInterval(vCycleImages);
}
}
jQuery.preloadImages = function() {
var bImgLoaded = true;
for(var i = 0; i < arguments.length; i++){
if (document.getElementById(arguments[i]).complete == false) {
bImgLoaded = false;
}
}
return bImgLoaded;
}
Hope this helps.
Samir Pipalia
Pipalia Software House
http://www.pipalia.co.uk