Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Created December 7, 2015 22:16
Show Gist options
  • Save ericakfranz/b3f7c45d83bd7dcddcb3 to your computer and use it in GitHub Desktop.
Save ericakfranz/b3f7c45d83bd7dcddcb3 to your computer and use it in GitHub Desktop.
Stop a video from playing in our Canvas lightbox optin when it closes.
jQuery(document).ready( function($){
//Snag the URL of the iframe so we can use it later
var url = $('.optin_custom_html_applied iframe').attr('src');
$(document).on('OptinMonsterOnClose', function( event, data, object){
//Assign the iframe's src to null, which kills the video
$('.optin_custom_html_applied iframe').attr('src', '');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment