Problems with mouseout event

后端 未结 6 1395
忘了有多久
忘了有多久 2021-02-09 15:11

I\'m using JavaScript to hide an image and show some text thats hidden under it. But, when the text is shown if you scroll over it, it fires the mouseout event on the container,

6条回答
  •  失恋的感觉
    2021-02-09 15:34

    This may not be the best solution but you could set a global boolean variable that would be accessible to both methods that would just specify if the last action was HoverIn or HoverOut. You could use this boolean variable to determine if the code should run or not.

    if (bWasHoverIn){
       ...
    }
    

提交回复
热议问题