悬停工具提示时,使qTip不会消失

Tow*_*wer 9 javascript jquery qtip2

我正在使用qTip:http://craigsworks.com/projects/qtip2,我当前的问题是当我将鼠标悬停在工具提示时它会消失(因为目标是mouseleave/mouseout).

当我悬停工具提示时,有没有办法让它保持可见?我将工具提示定位在目标下方,因此目标和工具提示之间没有空的空间.

jdl*_*dlm 16

使用fixed:http://craigsworks.com/projects/qtip2/docs/hide/#fixed

如果delay触发元素和工具提示之间存在一定距离,您可能希望在工具提示消失之前添加一个.

例如

$('.moreinfo').qtip({
    content: {
        text: $('<p>This is a tooltip.</p>')
    },
    show: {
        effect: function() { $(this).fadeIn(250); }
    },
    hide: {
        delay: 200,
        fixed: true, // <--- add this
        effect: function() { $(this).fadeOut(250); }
    },
    style: {
        classes: 'ui-tooltip-blue ui-tooltip-shadow ui-tooltip-rounded'
    }
});
Run Code Online (Sandbox Code Playgroud)

希望能帮助到你.