小编Inn*_*ons的帖子

Jquery mouseover/mouseleave

我不确定要搜索什么,但这是我的问题.

<script>
    function Gbox () {
        var hide = document.getElementById('g-box').style.display = "none";

    }
    Gbox();
    $("#g-plus").mouseover(function () {
        $("#g-box").show(400);  
    });
    $("#g-plus").mouseleave(function () {
        $("#g-box").hide(400);  
    });

</script>
Run Code Online (Sandbox Code Playgroud)

说Jquery没有问题.

唯一的问题是,如果我在#g-plusJquery 上快速进出2次,那么它会运行4次,show,hide,show,hide当它发生时看起来很迟钝

我该如何避免这个问题?

javascript jquery

1
推荐指数
2
解决办法
447
查看次数

标签 统计

javascript ×1

jquery ×1