diff options
| author | Alexander Kavon <me+git@alexkavon.com> | 2025-12-02 18:49:03 -0500 |
|---|---|---|
| committer | Alexander Kavon <me+git@alexkavon.com> | 2025-12-02 18:49:03 -0500 |
| commit | 6f1405350b4b8b47c042631845a99f0f4e43e86e (patch) | |
| tree | 1eb340d2e4dc71ea46a46ff2500ceb46830bd477 /rapbot/play.js | |
create repo, add website, rapbot files
Diffstat (limited to 'rapbot/play.js')
| -rwxr-xr-x | rapbot/play.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/rapbot/play.js b/rapbot/play.js new file mode 100755 index 0000000..6861d31 --- /dev/null +++ b/rapbot/play.js @@ -0,0 +1,27 @@ +$(document).ready(function() { + + var allAudio = $('audio'); + + function pauseAllAudio() { + allAudio.each(function() { + var a = $(this).get(0); + a.pause(); + a.currentTime = 0; + }); + }; + + $(".play").click(function() { + var tune = $(".current").attr("id"); + var realtune = $("#"+tune)[0]; + realtune.play(); + }); + + $(".next").click(function() { + pauseAllAudio(); + }); + + $(".prev").click(function() { + pauseAllAudio(); + }); + +}); |
