Support » Plugin: Easy FancyBox » [Plugin: Easy FancyBox] Launch mailto close fancybox in iFrame?

  • Resolved robgnyc

    (@robgnyc)


    How would I have a button (simple image wrapped in a href or <button>) both launch a mail to link and then close the fancybox window?

    I’m launching an iframe from the WordPress menu to show a disclaimer and want the user to click “I Agree” then get their email client launched and have the Fancybox close and leave them on same page they came from.

    http://wordpress.org/extend/plugins/easy-fancybox/

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

    (@ravanh)

    Hi, from within an iframe, you can use the script javascript:parent.$.fancybox.close();. Note that the page inside the iframe needs to be on the same domain as the parent page for it to work.

    Example:

    <a onclick="javascript:parent.$.fancybox.close();return true;" href="mailto:your@mail.addr&subject=agreement">I Agree</a>

    More info on http://fancybox.net/api

    I added this but it doesn’t seem to be working.

    The site is at:

    http://ogletree.mediumstudios.com/

    And link that launches the Fancybox comes off of the “Contact” submenu item (Blog Home About Contact) below the main blue menu bar.

    Added code exactly as written but modified for my mailto which is activated by the “I Agree to Terms” button.

    <a onclick="javascript:parent.$.fancybox.close();return true;" href="mailto:blog@ogletreedeakins.com?subject=Comments for Ogletree Deakins Blog">

    Any help would be much appreciated.

    Plugin Author RavanH

    (@ravanh)

    Sorry, that should be

    parent.jQuery.fancybox.close();

    since WordPress runs jQuery in noConflict mode…

    Thanks that worked. Great support. Great plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Easy FancyBox] Launch mailto close fancybox in iFrame?’ is closed to new replies.