Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Last active August 3, 2022 10:59
Show Gist options
  • Save yuriinalivaiko/edea02a66f95f3dbf26532dd27af9da2 to your computer and use it in GitHub Desktop.
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.
/**
* 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 );
} );
<?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
} );
@yuriinalivaiko
Copy link
Author

yuriinalivaiko commented Jul 17, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment