Link to home
Start Free TrialLog in
Avatar of jrattinger
jrattinger

asked on

jquery lightbox - multiple links to one image

I have and image on a page that Is using lightbox for zoom. Additionally, I have a button that has a hyperlink to the same image and want that to also use lightbox for zoom. The problem is that when selecting either the image or the button, the lightbox does zoom, but it shows that is has 2 images (ie 1 of 2). I simply want both links to only display on image in the lightbox.

see below of the code I am using. I am simply including the lightbox class in my <a> definition. I have tried multiple iterations on enabling lightbox in difference ways, without any luck.

Any incite would be greatly appreciated!

Thanks,
John
<table width="300">
<tr>
<TD width="300" height="300" rowspan="1" valign="top"><a href="<%=getCurrentAttribute('item','custitemimage_500')%>" title="<%=getCurrentAttribute('item','storedisplayname2')%>" class="lightbox"><img src="<%=getCurrentAttribute('item', 'storedisplayimage')%>" border="0" /></a></TD>
</tr>
 
<tr>
<td>
<div>
<div style="padding-left: 0px; width: 300px;">
<div style="height:40px;">
<div class="lnk-HedOff" style="background-color:#fcb124; color: rgb(3, 3, 3); font-family: Arial,Sans-Serif; font-weight: bold; font-size: 12px; height: 40px; text-align: left;">
 
<div style="text-align: center; padding-left: 80px; padding-right: 80px; padding-top:10px;">
<a href="<%=getCurrentAttribute('item','custitemimage_500')%>" title="<%=getCurrentAttribute('item','storedisplayname2')%>" class="lightbox" style="text-align: center;">Select For Image Zoom</a>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of DanDauchy
DanDauchy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jrattinger
jrattinger

ASKER

That works!

what I did was reference 2 different classes (lightbox1, lightbox2) in my HTML. Additionally, I had to create another function (now there are 2) that gets called when the appropriate link is selected.

I'm ok with this at the moment, although I have some concerns about scale. If I had more images to zoom, this might get messy. Any thoughts?

John
I don't think scale will be a problem.  I'm under the impression that lightbox will only display each new image once at a time.
oh wait I misunderstood your question.

For inserting new pictures into this page I would recomment using the class lightbox1 for all pictures and lightbox2 for all buttons.  That way you'll only ever have 2 lightboxes on the screen.

I've never tried to use 2 at the same time.  Do they work well toghether? or do they overlap?
Hmmm, that should work, i think...

This appears to work well in both IE and firefox. I can only access one at a time, so no overlap issues.

Thanks Much!
Great response from expert.
You've very welcome!

This was the last question I needed to answer to get Expert status!

yaya thanks!