Make Fancybox treat text links to pictures as well

231 views
Skip to first unread message

GhostLyrics

unread,
May 18, 2009, 7:33:05 AM5/18/09
to fancybox
I'd really love to completely switch from lightbox to fancybox, still
the only thing that stops me is having a lightbox plugin that also
treats said text links to pictures and turns them into lightboxes.
I hope it's not too hard/difficult to achieve this.

MrBlu905

unread,
May 25, 2009, 10:50:53 AM5/25/09
to fancybox
I was trying to accomplish the same thing. I had an image that if you
click would activate fancybox. I also had text under the image
"enlarge image" that i wanted to trigger fancybox. All i had to do was
give the anchor's different ID names for the images and the text.

For example

$("a#image").fancybox();
$("a#text").fancybox();

Hope this helps!

JFK

unread,
May 25, 2009, 1:27:04 PM5/25/09
to fancybox
actually you can have a single class and assign it to either, the text
link or image thumbnail (or both)
$("a.launch_fancybox").fancybox();

your html:

<a class="launch_fancybox">Open the image in modal box</a>

and/or

<a class="launch_fancybox"><img src="my_image_thumbnail.jpg" /></a>
Reply all
Reply to author
Forward
0 new messages