Created
September 16, 2015 02:18
-
-
Save danieliser/c395e43281c1cf550987 to your computer and use it in GitHub Desktop.
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 | |
add_action('wp_footer', 'my_custom_popup_scripts', 500 ); | |
function my_custom_popup_scripts() { ?> | |
<script type="text/javascript"> | |
jQuery('#popmake-123') | |
.on('popmakeBeforeOpen', function () { | |
var $iframe = jQuery('iframe', jQuery(this)), | |
src = $iframe.prop('src'); | |
$iframe.prop('src', '').prop('src', src + '/?autoplay=1'); | |
}) | |
.on('popmakeBeforeClose', function () { | |
var $iframe = jQuery('iframe', jQuery(this)), | |
src = $iframe.prop('src'); | |
$iframe.prop('src', '').prop('src', src.replace('/?autoplay=1', '')); | |
}); | |
</script><?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment