Button hover css removed
EeshanKumar opened this issue · comments
My button uses an image sprite as a background. On hover, it moves the image so it looks pressed. Here is my CSS.
button:hover {
background-position-x: 100%;
padding: 2px 0 0 2px;
}
This means when the element gets the new class, "zeroclipboard-is-hover", my css hover no longer applies.
@EeshanKumar Because there is a flash over the element, the element won't be hovered, so, it use flash to listen mouse event, and when the mouse is over the flash(also over the element), it create a css class named 'zeroclipboard-is-hover' for the element.
TL;DR
You should create a css class named zeroclipboard-is-hover
with the style you want for button hovered.
.zeroclipboard-is-hover {
background: url('your-sprite-image');
background-position-x: 100%;
padding: 2px 0 0 2px;
}
Got it. That's what I did but it's nice to hear the explanation of why. Thanks!