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>
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 Komentarze 0 Akcje 8K Widoki 0 Recenzje