A pure CSS solution for your request (the opacity property simply illustrates the need for transitions):
.hoverOnly:hover { pointer-events: none; opacity: 0.1; transition-delay: 0s; } .hoverOnly { transition: ,5s all; opacity: 0.75; transition-delay: 2s; }
What does he do:
When the mouse enters the field, it causes the state :hover . However, in this state, pointer events are disabled.
But if you do not set transition timers, the div will cancel the freezing state when moving the mouse; the freezing state will flicker when the mouse moves inside the element. You can perceive this using the code above with opacity properties.
Setting a delay to transition from a hover state corrects it. The value 2s can be changed according to your needs.
Conversion credits : patad for this answer .
Mindwin Dec 02 '16 at 16:30 2016-12-02 16:30
source share