Home › Forums › JavaScript › Hover event, but not on touch/mobile devices › Reply To: Hover event, but not on touch/mobile devices
November 25, 2019 at 7:47 am
#299532
Participant
Can be done with just CSS, no javaScript needed:
.preview {
/* display: none; */
opacity: 0;
position: absolute;
bottom: 0;
right: 0;
z-index: 1;
height: 50%;
transition: all .3s;
}
[id="test-parent"]:hover ~ .preview {
opacity: 1;
}