What I want to do is every time you put your mouse over the button, I want the White circle border, around the Play or Pause png to change to a different color no matter what state it’s in. Whether on or off.
I don’t know exactly how I would do this, but I was thinking adding a border div tag with a width and height and a different color to it. And then initiate the hover through that.
Will this work?
I’m not positive it will. It’s dramatically different from the other code so I’m confused.
All I’m doing is changing the border color around the play and pause onmouseover, and that’s it.
I’m confused on how to do this on different fronts.
1.) How do I initiate onmouseover on initial.
And then on pause and play classes subsequently.
Template Hover/OnMouseOver code.
Below Code:
On the new border class, I made it transparent so I wouldn’t have to make an additional class, both with play and pause images in them. I don’t know if this was smart, or if it’s not going to work.
New Border Class
https://jsfiddle.net/00much0n/
The hover part, I don’t know if this will work though.
<div class="border" style="display: ; margin: 0 auto;width: 36px;height: 36px;background-color: rgba(0,0,0,.7); background-color: transparent;border-radius: 50%;border: 1px solid red;cursor: pointer;"> </div>
<button id="playButton2" style="width: 79px; height: 79px; cursor: pointer; padding:0;border: 1px solid #0059dd;background-color: black;
background-image: url('https://i.imgur.com/ltrxz9z.jpg');background-repeat: no-repeat;background-size: cover;" onclick="
var button = document.getElementById('playButton2');
var player = document.getElementById('player2');
document.querySelector('#playButton2 .initial').style.display='none';
document.querySelector('#playButton2 .pause').style.display='none';
document.querySelector('#playButton2 .play').style.display='none';
player.volume=1.0; if (player.paused) {
document.querySelector('#playButton2 .pause').style.display='inline-block';
player.play();
} else {
document.querySelector('#playButton2 .play').style.display='inline-block';
player.pause();
}">
<div class="initial" style=";display:block; margin: 0 auto; width: 36px;height: 36px; background-color: rgba(0,0,0,.7);background-image: url('https://i.imgur.com/jqGA2vF.png');background-repeat: no-repeat;background-position: 58% 50%;border-radius: 50%;border: 1px solid white;cursor: pointer;"> </div>
<div class="pause" style="display: none; margin: 0 auto;width: 36px;height: 36px;background-color: rgba(0,0,0,.7); background-image: url('https://i.imgur.com/5nQe2FE.png');background-repeat: no-repeat;background-position: 50%;border-radius: 50%;border: 1px solid white;cursor: pointer;"> </div>
<div class="play" style="display: none; margin: 0 auto;width: 36px;height: 36px; background-color: rgba(0,0,0,.7);background-image: url('https://i.imgur.com/jqGA2vF.png');background-repeat: no-repeat;background-position: 58% 50%;border-radius: 50%;border: 1px solid white;cursor: pointer;"> </div>
</button>
<audio id="player2" style="display:none;">
<source src='http://hi5.1980s.fm/;' type='audio/mpeg'></source>
</audio>