I am currently implementing an image gallery which uses the Prototype
framework 1.4.0. The problem I am having is the first image (when
loaded) does not load its title and caption also. I have set the
gallery to preload = true.
Here is the script within my header.php:
var imgs0Slideshow = [];
var imgs0;
imgs0Slideshow[0] = {};
imgs0Slideshow[0].image = "http://www.culturesinbetween.net/NEWWEBSITE/
wp-content/uploads/front-arnsdorfimg.jpg";
imgs0Slideshow[0].title = "ARNSDORF - 'THE DAWN' AUTUMN/WINTER 2009";
imgs0Slideshow[0].caption = " shshshshshsh";
imgs0Slideshow[1] = new Object();
imgs0Slideshow[1].image = "http://www.culturesinbetween.net/NEWWEBSITE/
wp-content/uploads/front-arnsdorfimg.jpg";
imgs0Slideshow[1].title = "Array";
imgs0Slideshow[1].caption = " shshshshs";
imgs0Slideshow[2] = new Object();
imgs0Slideshow[2].image = "http://www.culturesinbetween.net/NEWWEBSITE/
wp-content/uploads/front-arnsdorfimg.jpg";
imgs0Slideshow[2].title = "Array";
imgs0Slideshow[2].caption = " shshshsh";
var start = 0;
imgs0 = new MudFadeGallery('imgs0', 'imgDisplay0', imgs0Slideshow,
{startNum: start, preload: true, autoplay: 4});
var title = (imgs0Slideshow[0].title) ? imgs0Slideshow[0].title : "No
Title";
var caption = (imgs0Slideshow[0].caption) ? imgs0Slideshow
[0].caption : "No caption";
var title = (imgsGallery[0].title) ? imgsGallery[0].title : "No
Title";
var caption = (imgsGallery[0].caption) ? imgsGallery[0].caption : "No
caption";
$("imgDisplay_title").innerHTML = title;
$("imgDisplay_caption").innerHTML = caption;
$("imgDisplay_number").innerHTML = "1 of " + imgsGallery.length + "
projects";
$("imgDisplay").src = imgsGallery[start].image;
This is within an external js file (edited to relavant part):
// runs right before fade begins
onFadeStart: function() {
var title = "";
var caption = "";
$(this.id+"_title").innerHTML = title ;
$(this.id+"_caption").innerHTML = caption;
$(this.id+"_number").innerHTML = (this.imgCurrent+1) + " of " +
this.imgTotal + " Articles";
},
// runs right after fade completes
onFadeEnd: function() {
var title = (this.imgsArray[this.imgCurrent].title) ?
this.imgsArray
[this.imgCurrent].title : "No Title";
var caption = (this.imgsArray[this.imgCurrent].caption) ?
this.imgsArray[this.imgCurrent].caption : "No caption";
$(this.id+"_title").innerHTML = title;
$(this.id+"_caption").innerHTML = caption;
},
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---