views:

115

answers:

3

Hi

I would like to view a gallery of images via Lightbox (or something similiar). The only problem is I need to display the image set in the viewer from a hyperlink rather than displaying thumbnails of the image set.

Does anyone know if this is possible; if so could you point me in the right direction.

EDIT:

I've edited this, to hopefully clarify my question.

What I want to do is have one hyperlink that when clicked opens a lightbox (or type of pop up viewer/gallery) that contains multiple images that the user can scroll through.

thanks

Barry

+1  A: 

this could be the direction.

$('a').click(function(){
var that = $(this)
var html= that.attr('href') // Read the href of the link and use it as reference for your lightbox.
$('body').append('<div id="shadow"><div id="fancybox"><img src="' + html +'" alt="pic" /></div></div>')
    $('#shadow').click(function(){
        $(this).remove()
    })
return false;
})

you can test it here: http://jsfiddle.net/hRcWN/2/

meo
Thanks meo - the demo looks good for single images. But I can't see how this would work for image sets. i.e multiple images from one link.
Barry
there are more then one possibility, you give them names like Gallery_1pic1.jpg and you just count the nubers up. Or you store your filenames somewhere. you have to be more specific, so i can make you a more specific solution.
meo
I've edited my question to hopefully clarify my situation
Barry
+2  A: 

Using lightbox, shadowbox or something similar it's no problem to use links without thumbnails.

<a rel="lightbox[picturegallery]" href="pic1.jpg" title="Pic1">Pic1</a>
<a rel="lightbox[picturegallery]" href="pic2.jpg" title="Pic2">Pic2</a>
<a rel="lightbox[picturegallery]" href="pic3.jpg" title="Pic3">Pic3</a>

Further info and code examples can be found here.

Andreas Schuldhaus
I've edited my question to hopefully clarify my situation
Barry
+1  A: 

if you are using JQuery, then FancyBox is a good lightbox plugin to suite your needs.

With FancyBox what you can use is, inline modal window to display images in a lightbox; when a hyperlink is clicked.

examples tailored for your need are at the bottom of this page: Examples of manual call

phoenix24
Thanks - this is exactly what I'm looking for. Thanks to the other replies for their help also.
Barry