Topic: Links in Captions

Hi,

I'm trying to format links in the caption (different color, underline when hovered), and I've tried editing the gallery.xml file with style classes for the links but apparently whatever SimpleViewer is doing it's ignoring all defined classes within the embedded code.  Is there some other way I can go about changing the formatting for just the links within the captions?

Thanks,

John

Re: Links in Captions

A related question:  is there any way to include javascript functionality within the links that are part of the caption?  For example, I'm trying out implementing Highglide for a pop-up on the link, using something like:

<a href="index.htm" onclick="return hs.htmlExpand(this, { headingText: 'Lorem ipsum' })">

sample text link

</a>

while including in the body of index.html some more divs:

<div class="highslide-maincontent">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam dapibus leo quis nisl. In lectus. Vivamus consectetuer pede in nisl. Mauris cursus pretium mauris. Suspendisse condimentum mi ac tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec sed enim. Ut vel ipsum. Cras consequat velit et justo. Donec mollis, mi at tincidunt vehicula, nisl mi luctus risus, quis scelerisque arcu nibh ac nisi. Sed risus. Curabitur urna. Aliquam vitae nisl. Quisque imperdiet semper justo. Pellentesque nonummy pretium tellus.
</div>

Of course, I'm linking to the correct .js and .css files and graphics, and everything works without SimpleViewer, but if I try plugging in that <A HREF stuff into gallery.xml, then nothing happens...

Any chance this can be done?  Thanks in advance.

Last edited by fuzen (2013-01-04 03:40:02)

Re: Links in Captions

Is there some other way I can go about changing the formatting for just the links within the captions?

You can add HTML formatting to your captions (or to just the links within your captions) as documented in this FAQ:
How do I add HTML formatting to my captions?

Please note that Adobe Flash supports only the 'target' and 'href' attributes for the anchor <a> tag (and not other attributes such as 'onclick'). Please see here for a complete list of HTML tags and attributes supported by Adobe Flash.

is there any way to include javascript functionality within the links that are part of the caption?

You can include a JavaScript function in the HTML page which contains the embedding code, such as:

<script type="text/javascript">
    function test() {
        alert("Hello, world!");
    }
</script>

... and then call the function from a link within a caption such as:

<caption><![CDATA[<a  href="javascript: test()" target="_self">Click here to call JavaScript function.</a>]]></caption>
Steven Speirs
SimpleViewer Support Team.

Re: Links in Captions

Thanks for the help.  So, just to be clear, in the caption, I'm unable to use CSS style definitions?

That is, define a style (say, "photographer") in a style sheet or in the header, and then call the style in the <A> tag, like <A HREF="/something.asp" CLASS="photographer">?

Or is there some way I can work around this?

Re: Links in Captions

I'm mainly trying to make it so that when you hover over a link an underline appears, in order to remain stylistically consistent with the rest of the site.  I've always done this using a:hover styles, which... doesn't work with the index.asp generated by SimpleViewer.  If there's some way to do it with the gallery.xml file, that'd be fantastic.

Re: Links in Captions

So, just to be clear, in the caption, I'm unable to use CSS style definitions?

That is correct. The <a> tag within Adobe Flash does not support 'class' or 'style' attributes.

I'm mainly trying to make it so that when you hover over a link an underline appears, in order to remain stylistically consistent with the rest of the site.

As far as I am aware, this is not possible in the Flash Player version of SimpleViewer-Pro.
However, it should work in the Mobile Player version of SimpleViewer-Pro (which, being HTML-based, does not have the limitations imposed by Adobe Flash) by using a caption such as the following:

<caption><![CDATA[<a href="#" onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'">Link Text</a>.]]></caption>

You can force the Mobile Player to be used to display your gallery on all devices and in all browsers (regardless of whether or not Adobe Flash Player is available) by setting the useFlash Embed Code Parameter to 'false' in your embedding code.
If using svBuilder-Pro to create or edit your gallery, the 'Use Flash' configuration option can be found in the 'Customize -> Embed Options' section.

Steven Speirs
SimpleViewer Support Team.