I have written a function in JavaScript to enlarge a button and immediately shrink back down to the original size.
It works using other CSS properties. For example, I've changed the color to blue and this works as expected.
Does anybody know why its not doing the same with transform?
Thanks in advance! :)
var btnE = document.querySelector(".btn-e");
btnE.addEventListener('mouseover', function() {
btnE.classList.add("btn-eScript")
})
btnE.addEventListener("transitionend", function() {
btnE.classList.remove("btn-eScript")
})
.btn-e {
margin-left: 155px;
background-color: rgba(83, 155, 232, 0.9);
}
.btn-s {
margin-left: 120px;
background-color: rgb(236, 130, 139);
}
.btn-s,
.btn-e {
text-decoration: none;
color: white;
font-size: 90%;
font-weight: 100;
text-align: center;
padding: 10px 20px;
border-radius: 25px;
transition: 0.15s;
}
.btn-eScript {
color: blue;
transform: scale(1.5);
}
<div class="btns">
<a class="btn-s" href="#">Más demos</a>
<a class="btn-e" href="#">Más demos</a>
</div>