Fancybox - getting html from element based on id?

Posted by kastru on Stack Overflow See other posts from Stack Overflow or by kastru
Published on 2010-06-02T21:48:04Z Indexed on 2010/06/02 21:54 UTC
Read the original article Hit count: 147

Filed under:
|
|

I have the following snippet;

$("a.lightbox_image").each(function () {
        $(this).fancybox({
            'transitionIn': 'elastic',
            'transitionOut': 'elastic',
            'speedIn': 600,
            'speedOut': 200,
            'content': $('#lightbox_image_content_'+this.id.replace('lightbox_image_','')).html()
        });
    });

But the above does not get the content from the element referenced to in the content property - what am i doing wrong?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery