Mootools 悬停时保持活动状态的浮动提示

Mootools 悬停时保持活动状态的浮动提示,mootools,tooltip,Mootools,Tooltip,我正在为我的项目使用FloatingTip工具提示,我正在为如何在光标位于工具提示上时保持活动状态而努力 Hear是JSFIDLE[][1] 例如:当鼠标悬停在工具提示和锚点上时,让我看看工具提示保持打开状态 详细链接: 有什么想法或建议吗?谢谢。不幸的是,这个插件目前没有这样的选项,但是它有方法和事件,所以你可以使用它们来实现这个行为。代码可能如下所示: $$('#advanced a').each(function(elem){ var instance = new Floating

我正在为我的项目使用FloatingTip工具提示,我正在为如何在光标位于工具提示上时保持活动状态而努力
Hear是JSFIDLE
[
][1]
例如:当鼠标悬停在工具提示和锚点上时,让我看看工具提示保持打开状态

详细链接:


有什么想法或建议吗?谢谢。

不幸的是,这个插件目前没有这样的选项,但是它有方法和事件,所以你可以使用它们来实现这个行为。代码可能如下所示:

$$('#advanced a').each(function(elem){
    var instance = new FloatingTips(elem, {
        // example options
        content: function() { return $('htmlcontent'); },
        html: true,         // I want that content is interpreted as HTML
        center: false,      // I do not want to center the tooltip
        arrowOffset: 16,    // Arrow is a little more the the right
        offset: { x: -10 }, // Position offset {x, y}

        // override show/hide events
        showOn: null,
        hideOn: null
    });

    // customize tooltip behavior
    var delay = 100, timer;

    var tipHover = function() {
        clearTimeout(timer);
    }
    var tipLeave = function() {
        clearTimeout(timer);
        timer = setTimeout(function(){
            instance.hide(elem);    
        }, delay);
    }

    instance.addEvents({
        show: function(tip, elem){
            tip.addEvents({
                mouseover: tipHover,
                mouseout: tipLeave                    
            });
        },
        hide: function(tip, elem){
            tip.removeEvents({
                mouseover: tipHover,
                mouseout: tipLeave                    
            });   
        }
    });

    elem.addEvents({
        mouseover: function() {
            clearTimeout(timer);
            timer = setTimeout(function(){
                instance.show(elem);    
            }, delay);                
        },
        mouseout: function() {
            clearTimeout(timer);
            timer = setTimeout(function(){
                instance.hide(elem);    
            }, delay);  
        }
    });
});
检查更新的小提琴: