【问题标题】:make qtip disappear right away让qtip立即消失
【发布时间】:2011-06-26 04:13:02
【问题描述】:
所以我希望 qtip 有以下行为:
当我单击对象时应该显示 qtip(我可以正常工作)...但是我希望它在几毫秒后消失,而无需我做任何事情...。你会怎么做去配置qtip来做到这一点?
我试过了
hide: {
when : 'inactive',
delay : 100,
fixed: false
}
但它不起作用....
任何帮助将不胜感激...谢谢
【问题讨论】:
标签:
javascript
jquery
events
mouseover
qtip
【解决方案1】:
如果您只希望工具提示在屏幕上闪烁:
$(".tooltip").qtip({
content: "Test tooltip",
api: {
// As soon as the qtip is fully visible..
onShow: function (event) {
// Keep a reference to the qtip..
that = this;
// After 1ms (to let things settle down)
setTimeout(function () {
// Hide the qtip
that.hide();
}, 1); // change this value to have it stay on screen longer
}
},
show: "mouseover"
});
【解决方案3】:
我知道这是一个老问题,但以防万一有人路过,在 qTip2 中正确的做法是:(事件而不是 api)
events: {
show: function(event, api){
var that = this;
setTimeout(function () {
// Hide the qtip
that.hide();
}, 3000); // change this value to have it stay on screen longer
}
}