You're not getting the alert about the missing wrapper division? Or did you also edit that out? Unless you did take that out there's an error like a missing script, or some syntax problem so great, we never get to it (the alert).
All I can tell you for sure from what you have presented here is that it's not the ideal way to go about it. You should only create an instance (new fadeSlideShow) of a slideshow on a page if you are going to use it on that page. You can make up all the properties in a global file and then only make an instance out of the one you want on a particular page, like:
Code:
var breakfastshow = {
wrapperid: "fadeshow-breakfast", //ID of blank DIV on page to house Slideshow
dimensions: ['100%', 330], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://www.sitename.com/media/fade-breakfast1.jpg"],
["http://www.sitename.com/media/fade-breakfast2.jpg"],
["http://www.sitename.com/media/fade-breakfast3.jpg"],
["http://www.sitename.com/media/fade-breakfast4.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:5000, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
};
var lunchshow = {
wrapperid: "fadeshow-lunch", //ID of blank DIV on page to house Slideshow
dimensions: ['100%', 330], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://www.sitename.com/media/fade-lunch1.jpg"],
["http://www.sitename.com/media/fade-lunch2.jpg"],
["http://www.sitename.com/media/fade-lunch3.jpg"],
["http://www.sitename.com/media/fade-lunch4.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:5000, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
};
The above script, jQuery and the fadesliseshow.js could be available to all pages. Now these (above) only represent the properties for each potential show, nothing has been set in motion (no instance has been created). Then on a given page you could have (inside script tags):
Code:
var mygallery = new fadeSlideShow(breakfastshow);
or:
Code:
var mygallery = new fadeSlideShow(lunchshow);
With PHP only supplying the highlighted, and of course the desired wrapper division in the HTML part of the page for that show.
But, regardless of how you work it out, between PHP and javascript and several instances of that script being used on several pages, there are many workable, and unworkable ways to do it. And one mistake can often male a workable method do nothing. The only way to really troubleshoot problems is to look at the live page(s).
So, if you want more help, please link us to the problem page(s) so we can check them out.
Bookmarks