Last active
August 3, 2022 10:59
-
-
Save yuriinalivaiko/edea02a66f95f3dbf26532dd27af9da2 to your computer and use it in GitHub Desktop.
Use one of these code snippets to fix a form view in popup. This example uses a button selector for the Elementor popup. Change a button selector to use this code with another popup plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A code snippet that triggers the "resize" once the popup is open. | |
* Add this code to your custom JS file. | |
*/ | |
jQuery( '.elementor-button[href^="#elementor-action"]' ).on( 'click', function () { | |
setTimeout( function() { | |
jQuery( window ).trigger( 'resize' ); | |
}, 100 ); | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A code snippet that triggers the "resize" once the popup is open. | |
* Add this code to the file functions.php in the active theme directory. | |
*/ | |
add_action( 'wp_footer', function () { | |
?><script type="text/javascript"> | |
jQuery( '.elementor-button[href^="#elementor-action"]' ).on( 'click', function () { | |
setTimeout( function() { | |
jQuery( window ).trigger( 'resize' ); | |
}, 100 ); | |
} ); | |
</script><?php | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is a part of the article Fix a form view in pop-up.
Documentation: https://docs.ultimatemember.com/
Support forum: https://wordpress.org/support/plugin/ultimate-member/