I have found this simple slideshow script and have been successful in getting it to work.
Code: Select all
<script type="text/javascript" src="catalog/view/javascript/simplegallery.js">
/***********************************************
* Simple Controls Gallery- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript">
var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [500, 400], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
imagearray: [
["image/palm_treo_pro_3.jpg", "http://en.wikipedia.org/wiki/Swimming_pool", "_new", "There's nothing like a nice swim in the Summer."],
["image/nikon_d300_1.jpg", "http://en.wikipedia.org/wiki/Cave", "", ""],
["image/iphone_3.jpg", "", "", "Eat your fruits, it's good for you!"],
["image/macbook_1.jpg", "", "", ""]
],
autoplay: [true, 2500,999], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 700, //transition duration (milliseconds)
oninit:function(){ //event that fires when gallery has initialized/ ready to run
//Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
},
onslide:function(curslide, i){ //event that fires after each slide is shown
//Keyword "this": references current gallery instance
//curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
//i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
}
})
</script>
If I need to change templates I have to copy all the codes to the new template.
My questions:
1. Is there somewhere I can place the above script to make it template independent (so slideshow would work across template switching without anymore code editing)
2.As you will noticed from the code, the image filenames are hardcoded so code needs to be edited each time you need to change images. Can anyone give me some hints and ideas how to replace this with variable and get it to read the files in a specific folder eg. /image/slideshow
3. there are settings in the simplegallery.js that controls certain features of the slideshow eg transition time. How would I control these from the admin back-end.
thanks for and help an ideas.