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 Commentarios
0 Acciones
8K Views
0 Vista previa