我正在使用 qTip: http: //craigsworks.com/projects/qtip2,我目前的问题是,当我悬停工具提示时它会消失(因为目标是 mouseleave/mouseout)。
当我悬停工具提示时,有没有办法让它保持可见?我将工具提示放置在目标下方,因此目标和工具提示之间的空白空间为零。
我正在使用 qTip: http: //craigsworks.com/projects/qtip2,我目前的问题是,当我悬停工具提示时它会消失(因为目标是 mouseleave/mouseout)。
当我悬停工具提示时,有没有办法让它保持可见?我将工具提示放置在目标下方,因此目标和工具提示之间的空白空间为零。
使用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'
}
});
希望能帮助到你。
使用 fixed: true 和 leave: false
您可能遇到的问题是,当您离开 qtip 目标时,它会隐藏起来。
出于某种原因,fixed:true
单独使用对我不起作用。相反,我不得不使用这些配置(v3.0.3):
hide: {
fixed: true,
delay:90,
},
position: {
viewport: $(window)
},