tanya
tanya

Reputation: 2985

Lightbox2 - display div's content instead of image

I would like to know how to use Lightbox2 to display the contents of a div.

Currently I am using the following line of code to display an image.

<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>

Is it possible to display a div's content instead of the image?

Thanks for any hints provided :)

Upvotes: 2

Views: 2771

Answers (1)

alt
alt

Reputation: 13907

Lightbox is for images. If you're looking to display content, create a new page and embed an iframe with Fancybox: http://fancybox.net/

To do iframe, include jquery, then the necissary fancybox javascript & css files you can download, then call it with this code:

<script>
$("a.fancyiframe").fancybox({
    'type':'iframe',
});
</script>

then setup your link element:

<a class="fancyiframe" href="http://www.yoursite.com/place.html">This goes to iframe</a>

Upvotes: 1

Related Questions