使用jquery qTip2作为工具提示。
我有一个工具提示,里面有一个链接。如果用户的鼠标进入提示(而不是触发器),我希望提示保持打开。似乎不知道如何在documentation中做到这一点……
发布于 2011-08-31 10:00:05
如果希望在将鼠标悬停在提示上并移入提示时保持可见,但仍希望在鼠标移出时取消显示,请使用described in the documentation here和delay选项
$('.selector').qtip({
content: {
text: 'I hide on mouseout, but you can mouse into me within 500ms',
},
hide: {
fixed: true,
delay: 500
}
});
hide参数有许多选项。例如,如果您不想无限期地隐藏它,只需将hide设置为false:
$('.selector').qtip({
content: {
text: 'I never hide',
},
hide: false
});
如果希望它隐藏在不同的事件上,例如在提示之外的任何位置单击,请显式设置该事件:
$('.selector').qtip({
content: {
text: 'I hide when you click anywhere else on the document',
},
hide: {
event: 'unfocus'
}
});
如果希望在单击触发器时将其隐藏,请指定单击事件:
$('.selector').qtip({
content: {
text: 'I hide when you click the tooltip trigger',
},
hide: {
event: 'click'
}
});
有关更多信息,请具体查看the "hide" options documentation。
发布于 2011-11-23 02:12:19
如果希望提示保持打开状态,然后在用户单击目标外部或离开目标时将其隐藏:
show: {
event: 'mouseover'
},
hide: {
event: 'click mouseleave'
}
https://stackoverflow.com/questions/7249185
复制相似问题