The DOCTYPE on that page is fine for this script. You basically have two main problems:
- There is a conflict with the Lightbox scripts that are also on the page.
- All the external script code appears to get associated with each page, regardless of whether it is used on that page or not.
The first can be resolved by updating Lightbox to the most recent 2.04 release:
http://www.lokeshdhakar.com/projects/lightbox2/
However, since you are not using Lightbox on that page, if you could prevent its scripts and styles from being associated with the page, that would be better.
Which is sort of part of the second problem. I'm imagining that, for "simplicity's sake", every page has all of the same header includes, essentially they all have the same head. Even if you update Lightbox to a version that will 'play nice' with the slide show, the slide show won't be happy on pages where there is no slide show markup.
You can fix that by using a modified version of the slide show code, replace:
Code:
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [766, 400], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/1.jpg", "", "", "Nothing beats relaxing next to the pool when the weather is hot."],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/2.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Some day I'd like to explore these caves!"],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/1.jpg"],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/2.jpg", "", "", "What a beautiful scene with everything changing colors."] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})
with:
Code:
jQuery(function($){
var mygallery = {
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [766, 400], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/1.jpg", "", "", "Nothing beats relaxing next to the pool when the weather is hot."],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/2.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Some day I'd like to explore these caves!"],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/1.jpg"],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/2.jpg", "", "", "What a beautiful scene with everything changing colors."] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
};
if($('#' + mygallery.wrapperid).size() === 1){
new fadeSlideShow(mygallery);
}
});
That should take care of the two main problems. Now there is a minor issue, here:
Code:
imagearray: [
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/1.jpg", "", "", "Nothing beats relaxing next to the pool when the weather is hot."],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/2.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Some day I'd like to explore these caves!"],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/1.jpg"],
["/WebRoot/ntdb2/Shops/didi6439/MediaGallery/2.jpg", "", "", "What a beautiful scene with everything changing colors."] //<--no trailing comma after very last image element!
],
See the highlighted parts? You should either get rid of them, or customize them for your purposes. As it is now, they are still set to the values in the demo. Read the demo page's documentation to find out what these fields do. But, as I've indicated, if you aren't using them, you can get rid of them.
Bookmarks