WordPress.org

Support

Support » Plugins and Hacks » Modal Dialog » Help – Javascript Dialog Closure Callback

Help – Javascript Dialog Closure Callback

  • Hi.

    i have installed the plugin and it is working fine. I’m using it to show a mailchimp form and I want to hide the close button and have the overlay only close when the visitor clicks the “Subscribe” button (#mc-embedded-subscribe) on the mailchimp form.

    I’m certain the setting “Javascript Dialog Closure Callback” is where I need to be. I have some very basic Javascript skills but I am struggling to get this working.

    ive currently got this in the footer:

    <script>
    ( function( $ ) {
    	$( "#mc-embedded-subscribe" ).click(function() {
    		parent.jQuery.fancybox.close();
    	});
    })( jQuery );
    </script>

    This is not throwing any errors up but it isn’t achieving the desired effect. Can someone help me out here.

    Thanks

    http://wordpress.org/plugins/modal-dialog/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Yannick Lefebvre

    @jackdewey

    Have you checked with tools like Firebug if the callback function is actually being executed?

    galzalex

    @galzalex

    codemagnet’s code works for me. I added the code below the mailchimp code but the problem is, it still closes even if you won’t fill the form.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help – Javascript Dialog Closure Callback’ is closed to new replies.
Skip to toolbar