colorbox not displaying first caption from flickr gallery integration

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2011-03-16T20:47:40Z Indexed on 2011/03/17 0:10 UTC
Read the original article Hit count: 270

Filed under:
|
|
|
|

I am pulling small thumbnails into my page from the flickr API, and using Colorbox to display larger thumbnails and captions from the title attribute. Using the API with C#.

However, on the first instance of opening colorbox it does not display the caption from the anchors title attribute.

If you click next or previous then it appears. The actual caption is physically there in the source code, just not getting put into the colorbox window.

Demo here, if you click on a thumbnail you will see there is no caption, click next then prev and it will appear.

Here's the code:

<script type="text/javascript">
        $(function() {
            $("a[rel='group']").colorbox({ opacity: 0.75 });
        });
</script>

<a href='http://farm6.static.flickr.com/5015/5511378425_e63d4a62f7.jpg' title='Little Hermit (Peter Dunn)' rel='group' class='tooltip'>
    <img src='http://farm6.static.flickr.com/5015/5511378425_e63d4a62f7_s.jpg' alt='Little Hermit (Peter Dunn)' />
</a>

If i view source, the title attribute is populated with the caption, but if i ook in firebug it is not in the colorbox code.

Any help on this would be great Ive ran out of ideas!

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript