If anyone needs it, I finally worked it out.
Now there there's mouseover, or hover, to both, Play Audio and Mute Audio.
Code:
<script>
$(function() {
$("#mute").click(function(e) {
e.preventDefault();
var song = $('audio')[0]
if (song.paused){
song.play();
document.getElementById("mute").src = "images/music-off.png";
}else{
song.pause();
document.getElementById("mute").src = "images/music-on.png";
}
});
});
$("#mute").hover(function(e) {
var song = $('audio')[0];
if (song.paused){
$(this).attr("src", "images/music-on-over.png");
} else {
$(this).attr("src", "images/music-off-over.png");
}
}, function(e) {
var song = $('audio')[0]
if (song.paused){
$(this).attr("src", "images/music-on.png");
} else {
$(this).attr("src", "images/music-off.png");
}
});
</script>
Bookmarks