seanie_morris
03-11-2016, 11:41 AM
I know that this one is going to hit me like a tonne of bricks, but for now, I am stumped.
I want to use the slideshow on multiple pages, each page with its own set of images. In my index.php page, I have the following code in the <head> (I will portray this using just 2 pages as an example to not fill this post with code):
#fadeshow-breakfast #fadeshow-lunch .gallerylayer img{
width: 100%;
height: auto;
}
@media screen and (max-width: 860px){ /* when document is 860px or less */
#fadeshow-breakfast #fadeshow-lunch {
height: auto;
}
}
@media screen and (max-width: 600px){ /* when document is 600px or less */
#fadeshow-breakfast #fadeshow-lunch {
height: auto;
}
}
@media screen and (max-width: 480px){ /* when document is 480px or less */
#fadeshow-breakfast #fadeshow-lunch {
height: auto;
}
}
</style>
<script type="text/javascript" src="http://www.sitename.com/fadeslideshow/fadeslideshow.js">
</script>
<script type="text/javascript">
var mygallery=new fadeSlideShow({
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)
})
</script>
<script type="text/javascript">
var mygallery2=new fadeSlideShow({
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)
})
</script>
Then, I insert the only bit of code needed in a div, as follows:
page 1 (Breakfast) I use
<div id="fadeshow-breakfast"></div>
page 2 (Lunch) I use
<div id="fadeshow-lunch"></div>
There are 8 pages in this manner, however, the slideshow only works in the Breakfast page. In each instance in the <head> code in index.php, I have tried var mygallery=new fadeSlideShow and var mygalleryX=new fadeSlideShow where X is a sequential instance number (1 to 8), but to no avail.
The only change I made to fadeslideshow.js was to remove the black background.
Can anyone help please?
Regards,
Seanie.
I want to use the slideshow on multiple pages, each page with its own set of images. In my index.php page, I have the following code in the <head> (I will portray this using just 2 pages as an example to not fill this post with code):
#fadeshow-breakfast #fadeshow-lunch .gallerylayer img{
width: 100%;
height: auto;
}
@media screen and (max-width: 860px){ /* when document is 860px or less */
#fadeshow-breakfast #fadeshow-lunch {
height: auto;
}
}
@media screen and (max-width: 600px){ /* when document is 600px or less */
#fadeshow-breakfast #fadeshow-lunch {
height: auto;
}
}
@media screen and (max-width: 480px){ /* when document is 480px or less */
#fadeshow-breakfast #fadeshow-lunch {
height: auto;
}
}
</style>
<script type="text/javascript" src="http://www.sitename.com/fadeslideshow/fadeslideshow.js">
</script>
<script type="text/javascript">
var mygallery=new fadeSlideShow({
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)
})
</script>
<script type="text/javascript">
var mygallery2=new fadeSlideShow({
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)
})
</script>
Then, I insert the only bit of code needed in a div, as follows:
page 1 (Breakfast) I use
<div id="fadeshow-breakfast"></div>
page 2 (Lunch) I use
<div id="fadeshow-lunch"></div>
There are 8 pages in this manner, however, the slideshow only works in the Breakfast page. In each instance in the <head> code in index.php, I have tried var mygallery=new fadeSlideShow and var mygalleryX=new fadeSlideShow where X is a sequential instance number (1 to 8), but to no avail.
The only change I made to fadeslideshow.js was to remove the black background.
Can anyone help please?
Regards,
Seanie.