Skip to content

Instantly share code, notes, and snippets.

@bloqhead
Last active December 25, 2015 00:49
Show Gist options
  • Save bloqhead/6890507 to your computer and use it in GitHub Desktop.
Save bloqhead/6890507 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
$(function() {
// Vimeo pauser
function pauseVimeo() {
$('iframe[src*="vimeo.com"]').each( function (iterator, object) {
var url = $(object).attr('src').split('?')[0];
object.contentWindow.postMessage(JSON.stringify({ method:"pause" }), url);
});
}
// Attach it to a button
$('#pause').on( 'click', pauseVimeo );
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment