Use this modified version of the script (right click and 'Save As'):
simplegallery_center_ims.js
Set the dimensions of the gallery to the width of the widest image, and the height of the tallest image. There is a new optional background property for setting the background color of the gallery (defaults to 'black', any valid css value for background, including those for url, position, etc. may be used), example gallery:
Code:
var mygallery2=new simpleGallery({
wrapperid: "simplegallery2", //ID of main gallery container,
dimensions: [400, 265], //width/height of gallery in pixels. Should reflect dimensions of the width of the widest image, and the height of the tallest image
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg", "http://en.wikipedia.org/wiki/Swimming_pool", "_new", "There's nothing like a nice swim in the Summer."],
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "", ""],
["http://i30.tinypic.com/531q3n.jpg", "", "", "Eat your fruits, it's good for you!"],
["http://www.dynamicdrive.com/dynamicindex4/amster1.jpg", "http://en.wikipedia.org/wiki/Amsterdam", "_new"],
["http://www.dynamicdrive.com/dynamicindex4/amster2.jpg", "http://en.wikipedia.org/wiki/Amsterdam", ""],
["http://www.dynamicdrive.com/dynamicindex4/amster3.jpg", "", ""],
["http://www.dynamicdrive.com/dynamicindex4/amster4.jpg", "", ""]
],
autoplay: [false, 3000],
persist: true,
background: 'white', //background style for gallery
fadeduration: 1000, //transition duration (milliseconds)
oninit:function(){ //event that fires when gallery has initialized/ ready to run
},
onslide:function(curslide, i){ //event that fires after each slide is shown
//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)
}
})
Bookmarks