I have a switch where it’s history adjustments when you float, along with when you click it. To make it so it transforms when you click, I made it to where you make use of the mousedown
occasion. This appears to bypass the mouseenter
and also mouseleave
occasions. When the mousedown
occasion takes place, it appears to disable the CSS float occasions. I have actually currently attempted to include mouseenter and also mouseleave, and also it hasn’t functioned.
HTML –
<< div course="" shoot">" >.
Fire.
<.
CSS -
shoot {
size:200 px;
padding-top:20 px;.
elevation:40 px;.
font-size:18 px;.
background-color: #d 3d3d3;.
border-radius:30 px;.
font-family: Semi-Casual;.
shade: white;.
text-align: facility;.
margin: vehicle;.
}
. shoot: float {
background-color: #c 3c3c3;.
arrow: reminder;.
}
JavaScript -
allow switch = document.querySelector("". shoot"");.
button.addEventListener("" mousedown"",()=> > {
// REMEMBER TO REPAIR HOVER RESULT.
button.style.backgroundColor="" dodgerblue"";.
} ).
button.addEventListener("" mouseup"",()=> > {
button.style.backgroundColor="" #d 3d3d3"";.
} ).