3

I have an image of a product, with a "new product" image on top. When i throw the mouse on top of that, it takes it as if the mouse left the product picture.

Also, when i mouseover, the div that appears should not disappear because the mouse enters that.

Here is the current example: http://jsfiddle.net/euhcc/8/

4

3 回答 3

6

http://jsfiddle.net/euhcc/9/

我认为您正在寻找的是mouseleave而不是mouseout.

检查更新的小提琴,看看这是否是你要找的。

在 jQuery 中,mouseleave检查更多被元素及其后代覆盖的“区域”,而不是元素本身。$(this)这意味着如果您有一个元素呈现在该元素上(在上下文$(this)$(this):尽管有元素),然后使用mouseleave.

于 2012-07-26T09:45:00.647 回答
1

如果您只针对现代浏览器 - 指针事件:无;

http://jsfiddle.net/euhcc/10/

  <div style="position:absolute; width: 180px; pointer-events:none;">
于 2012-07-26T09:48:39.713 回答
0
    $(document).ready(function(){
    $('.retslet').hide();

        $('.billede_wrap').hover(function(){
           $('.retslet').slideDown("fast");
        },function(){
           $('.retslet').slideUp("fast");
        });
    });
​
于 2012-07-26T09:49:42.597 回答