0

我正在尝试修改此大型菜单的鼠标悬停速度或悬停速度,当用户将鼠标悬停在按钮上时,下拉菜单启动前会有 0.3 秒的延迟。这是实际站点http://adobe-accessibility.github.io/Accessible-Mega-Menu/

和这里的jquery:http: //adobe-accessibility.github.io/Accessible-Mega-Menu/js/jquery-accessibleMegaMenu.js

感谢任何提示。

在此先感谢,瑞克

4

2 回答 2

0

是的,请检查 megamenu.css 文件的第 139 和 151 行,只需更改Transitions ease的值。

    -webkit-transition: opacity 250ms ease 250ms, max-height 500ms ease, visibility 0s linear 500ms, top 0s linear 500ms;
       -moz-transition: opacity 250ms ease 250ms, max-height 500ms ease, visibility 0s linear 500ms, top 0s linear 500ms;
        -ms-transition: opacity 250ms ease 250ms, max-height 500ms ease, visibility 0s linear 500ms, top 0s linear 500ms;
         -o-transition: opacity 250ms ease 250ms, max-height 500ms ease, visibility 0s linear 500ms, top 0s linear 500ms;
            transition: opacity 250ms ease 250ms, max-height 500ms ease, visibility 0s linear 500ms, top 0s linear 500ms;

    border: 1px solid rgba(0,0,0,0.3);
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
}

.accessible-megamenu .accessible-megamenu-panel.open {
    visibility: visible;
    top: 3em;
    max-height: 1200px;
    opacity: 1;
    z-index: 1001;
    -webkit-transition: opacity 250ms ease, max-height 500ms ease, visibility 0s linear 0s, top 0s linear 0s;
       -moz-transition: opacity 250ms ease, max-height 500ms ease, visibility 0s linear 0s, top 0s linear 0s;
        -ms-transition: opacity 250ms ease, max-height 500ms ease, visibility 0s linear 0s, top 0s linear 0s;
         -o-transition: opacity 250ms ease, max-height 500ms ease, visibility 0s linear 0s, top 0s linear 0s;
            transition: opacity 250ms ease, max-height 500ms ease, visibility 0s linear 0s, top 0s linear 0s;
}

我希望这对你有帮助。

问候。

于 2014-04-25T19:50:46.967 回答
0

我实际上是在尝试通过 JQuery 来做到这一点。以下代码在鼠标移出时有 0.3 秒的延迟,但是我不确定如何使它适用于 MouseOver:

 _mouseOverHandler =  function (event) {
        clearTimeout(this.mouseTimeoutID);
        $(event.target) 
            .addClass(this.settings.hoverClass);
        _togglePanel.call(this, event);  
        if ($(event.target).is(':tabbable')) {
            $('html').on('keydown.accessible-megamenu', $.proxy(_keyDownHandler, event.target));
        }
    };

    /**
     * @name jQuery.fn.accessibleMegaMenu~_mouseOutHandler
     * @desc Handle mouseout event on mega menu.
     * @param {event} Event object
     * @memberof jQuery.fn.accessibleMegaMenu
     * @inner
     * @private

     Exit Time is now .300 seconds

     */
    _mouseOutHandler = function (event) {
        var that = this;
        $(event.target)
            .removeClass(that.settings.hoverClass);

        that.mouseTimeoutID = setTimeout(function () {
            _togglePanel.call(that, event, true);
        }, 300);
        if ($(event.target).is(':tabbable')) {
            $('html').off('keydown.accessible-megamenu');
        }
    };
于 2014-04-28T14:45:23.587 回答