# Creating multiple galleries with lightbox js

**URL:** <https://forum.kirupa.com/t/creating-multiple-galleries-with-lightbox-js/236302>\
**Category:** Uncategorized\
**Created:** [August 19, 2007, 4:58pm UTC](https://forum.kirupa.com/t/creating-multiple-galleries-with-lightbox-js/236302 "2007-08-19T16:58:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupafalcon](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@kirupafalcon](https://forum.kirupa.com/u/kirupafalcon)\
**Post date:** [August 19, 2007, 4:58pm UTC](https://forum.kirupa.com/t/creating-multiple-galleries-with-lightbox-js/236302/1 "2007-08-19T16:58:45Z")

</div>

anyone know how to create more then 1 image gallery with lightbox?

here’s the code im using, I a bit confused on where to place the additional folders for my separate galleries and how to modify the code. Any help would be great…

This is the javascript I typed in my header:

\<script type=“text/javascript”\>  
function LightboxDelegate1(url,caption) {  
var objLink = document.createElement(‘a’);  
objLink.setAttribute(‘href’,url);  
objLink.setAttribute(‘rel’,‘lightbox[iceland]’);  
objLink.setAttribute(‘title’,caption);  
Lightbox.prototype.start(objLink);  
}  
\</script\>

\<script type=“text/javascript”\>  
function LightboxDelegate2(url,caption) {  
var objLink = document.createElement(‘a’);  
objLink.setAttribute(‘href’,url);  
objLink.setAttribute(‘rel’,‘lightbox[hans]’);  
objLink.setAttribute(‘title’,caption);  
Lightbox.prototype.start(objLink);  
}  
\</script\>

This is the code in the flash button:

on (release) {  
getURL(“javascript:LightboxDelegate1(‘billeder/iceland/\_MG\_0725.jpg’ , ‘Seydisfjordur’)”);  
}

on (release) {  
getURL(“javascript:LightboxDelegate2(‘billeder/hans/hans\_01.jpg’ , ‘Hans Nielsen, dwarf’)”);  
}

Strangely enough, the caption I enter in the flash file is necessary, but it is the title written in the html document that counts:

\<a href=“billeder/iceland/\_MG\_0725.jpg” rel=“lightbox[iceland]” title=“Seyðisfjörður, Iceland”\>\</a\>  
\<a href=“billeder/iceland/\_MG\_0714.jpg” rel=“lightbox[iceland]” title=“Seyðisfjörður, Iceland”\>\</a\>

\<a href=“billeder/hans/hans\_01.jpg” rel=“lightbox[hans]” title=“Hans Nielsen, dværg”\>\</a\>  
\<a href=“billeder/hans/hans\_02.jpg” rel=“lightbox[hans]” title=“Hans Nielsen, dværg”\>\</a\>  
\<a href=“billeder/hans/hans\_03.jpg” rel=“lightbox[hans]” title=“Hans Nielsen, dværg”\>\</a\>  
\<a href=“billeder/hans/hans\_04.jpg” rel=“lightbox[hans]” title=“Hans Nielsen, dværg”\>\</a\>

heres the site that uses the code above:

[http://www.kaaresmith.dk/test.html](http://www.kaaresmith.dk/test.html)
