kimerlin
03-04-2011, 06:45 PM
Hi,
Is there a way to have the fancybox show images from another folder without the names having to match the thumbnails. In otherwords can you help me modify this code so the fancybox shows all images in the path location that have similar names to the thumbnail
Ie. Thumbnail name= before1.jpg
FancyBox pictures = before1a.jpg, before1b.jpg, before1c.jpg
Thumbnail name= before2.jpg
FancyBox pictures = before2a.jpg, before2b.jpg, before2c.jpg
-----------------------------------------------------------------------------------
Using the code you posted:
<script type="text/javascript">
phpimagealbum.prototype.createHiddenLinks = function(cfg){
cfg = cfg || {}; cfg.groupName = cfg.groupName || new Date().getTime();
var d = document.createElement('div'), tmpLink = document.createElement('a'), lbLink,
i = 0, av = this.albumvar, base = cfg.path || av.baseurl, avi = av.images, avil = avi.length;
d.style.display = 'none'; tmpLink.rel = 'fancybox_' + cfg.groupName;
for(i; i < avil; ++i){
lbLink = tmpLink.cloneNode(false);
lbLink.href = base + avi[i][1];
lbLink.title = avi[i][2];
lbLink.tabindex = avi[i][0];
d.appendChild(lbLink);
}
document.body.insertBefore(d, document.body.firstChild);
lbLink = d.getElementsByTagName('a');
$(lbLink).fancybox();
this.onphotoclick = function(ref, idx){
var i = lbLink.length -1;
for (i; i > -1; --i){
if(lbLink[i].tabindex == idx){
$(lbLink[i]).click();
break;
}
}
};
};
new phpimagealbum({
albumvar: ba_gallery, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [1,3],
sortby: ["file", "asc"] //["file" or "date", "asc" or "desc"]
}).createHiddenLinks({path: '<?= $this->site->asset_path('images/ba_galleryslides/') ?>'}); //takes optional object as argument, ex: {groupName: 'demopics', path: 'alternate_path_to_larger_images/'}
</script>
Is there a way to have the fancybox show images from another folder without the names having to match the thumbnails. In otherwords can you help me modify this code so the fancybox shows all images in the path location that have similar names to the thumbnail
Ie. Thumbnail name= before1.jpg
FancyBox pictures = before1a.jpg, before1b.jpg, before1c.jpg
Thumbnail name= before2.jpg
FancyBox pictures = before2a.jpg, before2b.jpg, before2c.jpg
-----------------------------------------------------------------------------------
Using the code you posted:
<script type="text/javascript">
phpimagealbum.prototype.createHiddenLinks = function(cfg){
cfg = cfg || {}; cfg.groupName = cfg.groupName || new Date().getTime();
var d = document.createElement('div'), tmpLink = document.createElement('a'), lbLink,
i = 0, av = this.albumvar, base = cfg.path || av.baseurl, avi = av.images, avil = avi.length;
d.style.display = 'none'; tmpLink.rel = 'fancybox_' + cfg.groupName;
for(i; i < avil; ++i){
lbLink = tmpLink.cloneNode(false);
lbLink.href = base + avi[i][1];
lbLink.title = avi[i][2];
lbLink.tabindex = avi[i][0];
d.appendChild(lbLink);
}
document.body.insertBefore(d, document.body.firstChild);
lbLink = d.getElementsByTagName('a');
$(lbLink).fancybox();
this.onphotoclick = function(ref, idx){
var i = lbLink.length -1;
for (i; i > -1; --i){
if(lbLink[i].tabindex == idx){
$(lbLink[i]).click();
break;
}
}
};
};
new phpimagealbum({
albumvar: ba_gallery, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [1,3],
sortby: ["file", "asc"] //["file" or "date", "asc" or "desc"]
}).createHiddenLinks({path: '<?= $this->site->asset_path('images/ba_galleryslides/') ?>'}); //takes optional object as argument, ex: {groupName: 'demopics', path: 'alternate_path_to_larger_images/'}
</script>