Last active
October 23, 2015 20:17
-
-
Save zeshanshani/886ab99fa421bc70bb59 to your computer and use it in GitHub Desktop.
Pause all audio players except the clicked one.
This file contains hidden or 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
// | |
// Pause all audio players except the clicked one. | |
// Script by Zeshan Ahmed (http://www.zeshanahmed.com/) | |
// | |
jQuery(document).ready(function($) { | |
$('.mejs-playpause-button button').click(function() { | |
$('audio').not( $(this).closest('audio') ).each(function(){ | |
this.pause(); | |
this.currentTime = 0; | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment