I’m working on a cart shopping on my website, when you hover, it should display another div just below the parent (with position absolute). The parent has position: relative
and the div I want to show is inside him with position: absolute;
I did just that, but my problem is that, when I try to move the mouse on the div, its disappearing, onMouseOut
is called and it also seems to be a little glitch when you hover the icon (its showing then hide then again showing)..
How can I fix?
3
Answers
Use
onMouseLeave
instead ofonMouseOut
You simply need to update your code to use onMouseEnter and onMouseLeave.
You don’t need to have an if condition to check the state. This works just fine.