I have javascript which check hoverin(mouse enter)
const hoverIn = (e)=>{
console.log("check hoverin");
}
return <li>
<img src="test.jpg" onMouseEnter={hoverIn}></img></li>
It fires hoverin
when mouse moves to the image, but when clicking, hoverin
does not fired.
then, I put the css tool tip on in.
const hoverIn = (e)=>{
console.log("check hoverin");
}
return <li className={styles['css_tooltip']}>
<span class={styles["css_tooltiptext"]}>ToolTip Text</span>
<img src="test.jpg" onMouseEnter={hoverIn}></img></li>
css file
/* Tooltip container */
.css_tooltip {
position: relative;
display: inline-block;
/*border-bottom: 1px dotted black;*/ /* If you want dots under the hoverable text */
}
/* Tooltip text */
.css_tooltip .css_tooltiptext {
visibility: hidden;
width: 120px;
background-color: rgba(0,0,0,0.4);
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
/* Position the tooltip text - see examples below! */
position: absolute;
z-index: 1;
}
/* Show the tooltip text when you mouse over the tooltip container */
.css_tooltip:hover .css_tooltiptext {
visibility: visible;
}
With this script, somehow when clicking, hoverin
is fired.
How can I prevent this??