Example script code for toogle on and off music.
<script type="text/javascript">
var myAudio = document.getElementById("myAudio");
var isPlaying = true;
function togglePlay() {
isPlaying ? myAudio.pause() : myAudio.play();
};
myAudio.onplaying = function() {
isPlaying = true;
};
myAudio.onpause = function() {
isPlaying = false;
};
</script>
<script type="text/javascript">
var myAudio = document.getElementById("myAudio");
var isPlaying = true;
function togglePlay() {
isPlaying ? myAudio.pause() : myAudio.play();
};
myAudio.onplaying = function() {
isPlaying = true;
};
myAudio.onpause = function() {
isPlaying = false;
};
</script>
Example script code for toogle on and off music.
<script type="text/javascript">
var myAudio = document.getElementById("myAudio");
var isPlaying = true;
function togglePlay() {
isPlaying ? myAudio.pause() : myAudio.play();
};
myAudio.onplaying = function() {
isPlaying = true;
};
myAudio.onpause = function() {
isPlaying = false;
};
</script>
0 Yorumlar
0 hisse senetleri
8K Views
0 önizleme