jquery mouseleave issue when moving too slow

前端 未结 1 788
清歌不尽
清歌不尽 2021-01-20 07:09

I am using the jQuery mouseenter and mouseleave events to slide a div down and up.

Everything works well except for the mouseleave which doesn\'t appear to fire ONLY

相关标签:
1条回答
  • 2021-01-20 08:01

    Try to use hover instead mouseenter and mouseleave;

    $(document).ready(function() {
        $("#div").hover(function() {
             $("#something").slideDown(400);
        }, function() {
             $("#something").slideUp(400);
        });
    });
    
    0 讨论(0)
提交回复
热议问题