Using Shadowbox.open... please help

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Shadowbox.open... please help

jay2007
I am unable to understand exactly how to use Shadowbox.open. I used the example in http://mjijackson.com/shadowbox/doc/usage.html, but that only goes as far as providing content as a string. But in my case, I don't actually have any anchor tags in the HTML. I need to simulate that purely via javascript. I tried giving the URL as value to the content (with and without the http://..), but it simply displays as a string. I used Firebug to traverse, and see that the isLink function returns false.

Please help me, I just need to do Shadowbox.open and pass in a URL (without having any a hrefs). thank you very much.
Reply | Threaded
Open this post in threaded view
|

Re: Using Shadowbox.open... please help

jontas
This took me a while to figure out.  Here's what you want:

        var options = {
                                                                                overlayOpacity: .4
                                                                        };
                                               
                                                Shadowbox.init({
                                                // let's skip the automatic setup because we don't have any
                                                // properly configured link elements on the page
                                                skipSetup: true
                                            });
                                       
                                            Shadowbox.open({
                                                type:       'iframe',
                                                height:     350,
                                                width:      350,
                                                        content: 'http://www.google.com'
                                            }, options);


The key is changing TYPE to "iframe"

Hope this helps,

Jon