WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Open Fancybox automatticly when #iframe

[Resolved] Open Fancybox automatticly when #iframe

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author RavanH
    Participant

    @ravanh

    Yes, you need to do two things:

    1. Give each link that you would like to be able to trigger on page load an ID. If you have more than one of those on one page, make sure to use unique IDs. For example, id=”iframe1″, id=”iframe2″ etc.

    2. Put the following javascript in a text widget or in your themes footer.php :

    <script type="text/javascript">
    window.onload = function() {
        if(window.location.hash) {
            jQuery(window.location.hash).trigger('click');
        }
    };
    </script>

    Now you can link to these pages, using each time the corresponding ID after the hash to make the link fire on page load. You can see examples on http://demo.status301.net/easy-fancybox-sandbox/pdf-embeds/

    applewerbung
    Member

    @applewerbung

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Open Fancybox automatticly when #iframe’ is closed to new replies.