PDA

View Full Version : Lightbox image viewer 2.03 + Photo Album script v2.0



chrimson
05-23-2007, 05:58 PM
Lightbox image viewer 2.03
http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

Photo Album script v2.0
http://www.dynamicdrive.com/dynamicindex4/photoalbum.htm

Hi, i am trying to combine Lightbox image viewer 2.03 and Photo Album script v2.0. my aim is to make it so that when a thumbnail in the photo album script is selected it then prompts the larger image to appear through the lightbox image viewer script.

i have already seen another post similar to this one but instead the person was asking about PHP Photo Album script and i found the solution was not the same, in any case im really new at this stuff so any help will be nice, thanks.

radiofriendlybox
09-11-2007, 12:21 AM
i don't have a solution, but i just wanted other readers to know i would very much like to see one!

jscheuer1
09-11-2007, 05:28 AM
Install the lightbox scripts and styles in the head of the page as instructed, and install the Photo Album script with these modifications -

Get rid of these two lines from the Photo Album's external script:


gdiv.onselectphoto=function(imgobj, linkobj){return true} //custom event handler "onselectphoto", invoked when user clicks on an image within gallery


gdiv.onclick=function(e){return photogallery.defaultselectaction(e, this)} //attach default custom event handler action to "onclick" event

Change this line:


imageHTML='<a href="'+imgparts[2]+'" target="'+linktarget+'">'+imageHTML+'</a>'

to:


imageHTML='<a href="'+imgparts[2]+'" title="'+imgparts[1]+'" rel="lightbox" onclick="myLightbox.start(this); return false;">'+imageHTML+'</a>'

Get rid of this stuff:


//OPTIONAL: Run custom code when an image is clicked on, via "onselectphoto"
//DELETE everything below to disable
//Syntax: function(img, link){}, whereby img points to the image object of the image, and link, its link object, if defined
thepics.onselectphoto=function(img, link){
if (link!=null) //if this image is hyperlinked
window.open(link.href, "", "width=800, height=600, status=1, resizable=1")
return false //cancel default action when clicking on image, by returning false instead of true
}

Make sure to use at least the 1st (thumbnail) and last (larger image) entries for each of the image array items:


myvacation[0]=["../photo1.jpg", "", "photo1-large.jpg"]

radiofriendlybox
09-11-2007, 11:22 PM
hi. thanks for the modification. on galleries with multiple "pages", this mod doesn't seem to work after Page 1. e.g., the lightbox effect works on Page 1, but not Pages 2, 3, 4 etc.



Install the lightbox scripts and styles in the head of the page as instructed, and install the Photo Album script with these modifications -

Get rid of these two lines from the Photo Album's external script:


gdiv.onselectphoto=function(imgobj, linkobj){return true} //custom event handler "onselectphoto", invoked when user clicks on an image within gallery


gdiv.onclick=function(e){return photogallery.defaultselectaction(e, this)} //attach default custom event handler action to "onclick" event

Change this line:


imageHTML='<a href="'+imgparts[2]+'" target="'+linktarget+'">'+imageHTML+'</a>'

to:


imageHTML='<a href="'+imgparts[2]+'" title="'+imgparts[1]+'" rel="lightbox" onclick="myLightbox.start(this); return false;">'+imageHTML+'</a>'

jscheuer1
09-12-2007, 02:53 AM
Works here, on three 'pages'.

Make sure that you are using the latest versions of both scripts (the latest versions available on Dynamic Drive - those are the ones I used), and that you have followed all of the instructions from my post exactly.

If you need more help:

Please post a link to the page on your site that contains the problematic script so we can check it out.

radiofriendlybox
09-12-2007, 09:20 PM
crikey! duh, i was using the first version of this script: http://www.dynamicdrive.com/dynamicindex4/lightbox/index.htm

sorry for being a dunce. what would the mod for this one be? works fine on the first "page", but not thereafter. more specifically, the script stops working correctly after you click on new "page".

you can see what i'm doing here: http://www.32-bits.com/dd_temp

(you can type in http://www.32-bits.com/dd_temp/js or /css to see the script/stylesheet.)

thanks!


Works here, on three 'pages'.

Make sure that you are using the latest versions of both scripts (the latest versions available on Dynamic Drive - those are the ones I used), and that you have followed all of the instructions from my post exactly.

If you need more help:

Please post a link to the page on your site that contains the problematic script so we can check it out.

tonyalegria
01-09-2008, 06:40 PM
I want to do the same, but something is wrong.
I'm using the latest version of the lightbox.
But my doubt is how to mix the
myvacation[0]=["1896/001t.jpg", "Foto 1", "1896/001.jpg"] ==> Photo Album
and
<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a> ==> Lightbox.

Here is a link to my page:
[broken link that now goes to adult content removed]

Thanks!!!