The one array being numeric and the other not makes no difference. All true javascript arrays are numeric. But, depending upon how they are defined in the code, these numbers need not necessarily be written out.
The real difference is that in the Simple Gallery array you are required to pass an image and optionally an href and target values. In the other array you are passing an entire string of HTML as the code that will be written to the page. This gives you more control over things, as you may include any attributes, style, etc. you like in the tags you are placing in there.
Perhaps the simplest way to get your rel="lightbox" in there would be to edit the simplegallery.js file here:
Code:
getSlideHTML:function(imgelement){
var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" rel="'+imgelement[2]+'">\n' : '' //hyperlink slide?
layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0" />'
layerHTML+=(imgelement[1])? '</a>' : ''
return layerHTML //return HTML for this layer
},
This will change the target specification in the Simple Gallery's array into a rel specification. So you then could have:
Code:
var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [250, 186], //width/height of gallery in pixels. Should reflect dimensions
//of the images exactly
imagearray: [
//["path_to_image", "optional_link", "optional_linktarget", "optional_textdescription"]
["examples/thumbs/Bath01.jpg", "examples/Bath01.jpg", "lightbox"],
["examples/thumbs/Bath02.jpg", , ,],
["examples/thumbs/Bath03.jpg", , ,],
["examples/thumbs/Bath04.jpg", , ,], . . .
Bookmarks