How can I set fancyBox's contents dynamically?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-04-09T02:07:55Z Indexed on 2010/04/09 2:13 UTC
Read the original article Hit count: 651

Filed under:
|
|
|

I have tried

$('.selector').fancybox({
                        scrolling       : 'no',
                        titleShow       : false,
                        type            : 'inline',
                        content         : '<p>hello</p>'

But it did not work

I have also tried adding the option

onComplete: function() {
                           $('#fancybox-inner').html(contents);

                        }

Except then when fancyBox is closed, it will not launch again.

How can I dynamically set the contents of fancyBox, and retain all of it's functionality?

Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html