简体   繁体   中英

Launch Fancybox iframe on Page Load

I have a page that uses fancybox to open a gallery and iframes for forms. I am wondering if I can have a hidden iframe link launch on page load while the others only open when user click on them.

Don't use hidden iframes , I think is a bad idea (even visible iframes are a bad idea too ;)

Try this instead

jQuery(document).ready(function ($) {
    $.fancybox({
        href: "http://jsfiddle.net", 
        type: "iframe"
    });
}); // ready

Notice that the URL in the href option corresponds to what you would set in the src attribute of your iframe

JSFIDDLE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM