9

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

当我悬停工具提示时,有没有办法让它保持可见?我将工具提示放置在目标下方,因此目标和工具提示之间的空白空间为零。

4

3 回答 3

17

使用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'
    }
});

希望能帮助到你。

于 2012-01-26T14:14:08.520 回答
2

使用 fixed: true 和 leave: false

您可能遇到的问题是,当您离开 qtip 目标时,它会隐藏起来。

于 2013-02-28T01:07:50.733 回答
0

出于某种原因,fixed:true单独使用对我不起作用。相反,我不得不使用这些配置(v3.0.3):

hide: {
   fixed: true,
   delay:90,
},
position: {
   viewport: $(window)
},
于 2017-03-06T18:50:39.337 回答