Topic: how to insert a lightbox effekt into caption..

Hi!
Been looking for an answer for quite  a long time...

I would like to have a lightbox or floatbox or what everbox effekt within caption text.

I did many test with gallery.xml    ... all failed.
I can style the text, use images in caption and of course hyperlinks, BUT
the lightbox effekt just doesn't work.

Is it possible or not?
Thats the question... if YES (hope so...)
HOW????????    roll

...  I managed to use a alert Box with javascript... thats ok - but not what I am looking for...

Last edited by martinius332 (2013-07-05 14:40:14)

Re: how to insert a lightbox effekt into caption..

You can call a JavaScript function (on the same page as your gallery's embedding code), using a caption such as:

<caption><![CDATA[<a href="javascript: func('text to be displayed');">click here</a>]]></caption>

Within that function, you could open a lightbox-style window (such as Shadowbox).

Include the Shadowbox CSS and JavaScript files in the <head> section of your web page:

<script type="text/javascript" src="shadowbox.js"></script>
<link rel="stylesheet" type="text/css" href="shadowbox.css">

... and use the following JavaScript code on your web page:

<script type="text/javascript">
Shadowbox.init({
    skipSetup: true
});
function func(text) {
    Shadowbox.open({
        content: '<span style="color: #ffffff;">' + text + '</span>',
        player: 'html',
        width: '600',
        height: '400'
    });                
}
</script>

I realise that this is not a complete solution and may require modification but I hope it points you in the right direction.
Shadowbox can be used to display text, images, complete web pages and more (please see the Shadowbox documentation for more information) but you may like to take a look around and try other lightbox-style scripts.
(When a Shadowbox window is opened on top of a Flash presentation, the Flash presentation is obscured until the Shadowbox window is closed. Please see the Shadowbox option troubleElements on this web page for more information.)

Steven Speirs
SimpleViewer Support Team.