开发者

jquery mouseover question

开发者 https://www.devze.com 2023-03-04 03:40 出处:网络
I have a jquery-script that triggers on mouseover on a div like this: <div class=\"myDiv\"> <span class=\"mySpan\">text text text</span&g开发者_StackOverflow中文版t;

I have a jquery-script that triggers on mouseover on a div like this:

<div class="myDiv">
    <span class="mySpan">text text text</span&g开发者_StackOverflow中文版t;
</div>

The problem is that it acts like mouseout when i hover over the text and I dont want that. I could put an invisible div over it all and trigger the moseover on that but I would like to keep it as simple as possible.

Any suggestions...?


You are looking for mouseleave / mouseenter not mouseout/mouseover

mouseleave fires when leaving the parent, while mouseout fires on children

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号