WordPress.org

Ready to get started?Download WordPress

Forums

Modal Dialog
Help - Javascript Dialog Closure Callback (3 posts)

  1. codemagnet
    Member
    Posted 9 months ago #

    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/

  2. Yannick Lefebvre
    Member
    Plugin Author

    Posted 9 months ago #

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

  3. galzalex
    Member
    Posted 7 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic