Button with settings
by Bacher
HTML
<button class="cont" id="aa">
<div class="sett">
OP
</div>
</button>
CSS
.cont {
display: inline-block;
width: 100px;
height: 20px;
border: 1px solid black;
overflow: hidden;
position: relative;
}
.cont:hover .sett {
transition: transform 0.5s;
transition-delay: 1s;
transform: translate(0, 0);
}
.sett {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: red;
transform: translate(0, 100px);
}
JavaScript
document.getElementById('aa').onclick = function(e) {
console.log(e.target);
}