tags:

views:

15

answers:

1

Hi All,

Been using FancyBox to display a swf player. What I would like to do is have an if statement that, when false adds the flash vars to 'swf': {...}, which I have working. And when true displays some inline markup.

            if (true) {
                $.fancybox({
                     'type': inline
                 //can I ref markup here???
                });
            } else {
                $.fancybox({
                        'href' : somepath,
                    'type': 'swf',
                    'swf': {..}
                });

}

Would someone be able to advise on how I can either reference the markup using the approach above. Or if I can even add dynamic html here, which would be a nicer approach.

Thanks in advance

Eddie

A: 

Hi All,

Solved this. Just incase anyone needs to do the same.

You just need to use the key content, which forces FancyBox to load the html content.

if(true){
                    var content = $('#someHtml').html();
                    $.fancybox({
                        'content': content,
                        'padding' : 20
                    });
}else{...}

Thanks

Eddie

Eddie