【发布时间】:2011-09-29 22:11:24
【问题描述】:
首先很抱歉在这里发布问题。 support forum 似乎快要死了。
所以我在 qtip 插件或我的代码中遇到了错误。当我连续调用.qtip('hide') 两次或更多次时,工具提示将隐藏,并且在调用.qtip('show') 时不再显示。
繁殖方式:
el.qtip('hide');el.qtip('hide');el.qtip('show'); \\ -> bug, the tip is not shown
el.qtip('hide');el.qtip('hide');el.qtip('hide');el.qtip('show'); \\ -> bug, same
连续show 效果很好...
el.qtip('show');el.qtip('show');el.qtip('hide');el.qtip('show'); \\ -> pass
非连续hide 也很好用:
el.qtip('hide');el.qtip('show');el.qtip('hide');el.qtip('show'); \\ -> pass
问题是:
如何让事情发挥作用? qTip api 无法让我找到提示是隐藏还是显示的方法。我怎么知道?我可以检查 qTip 是否隐藏而不是隐藏两次。
可能的问题来源:
导致错误的 qtip 以一种相当棘手的方式构建:
qtip({
content: text,
position: {
corner: {
target: 'rightMiddle',
tooltip: 'leftMiddle'
}
},
style: {
tip: {
corner: 'leftMiddle',
},
border: {
radius: 11,
width: 4
},
name: 'red'
},
show: {
delay:0,
ready: true,
fixed:true,
when: { target: false, event:false },
effect: function() {//.stop(true, true)
$(this).effect("drop", { direction: "down", mode: "show" }, 240)
}
},
hide: {
delay:0,
fixed:true,
when: { target: false, event:false },
effect: function() {//.stop(true, true)
$(this).effect("drop", { direction: "down", mode: "hide" }, 240)
}
}
})
要对此进行测试,您可以访问 www.buxdial.com/oldo/register.php,在验证码字段中输入任何内容,进入调试器并运行测试,将 el 替换为 code.TIP
【问题讨论】:
-
我开始使用 qTip,但我改变了。现在,我使用 TooptisY 作为工具提示(这非常好)。我使用 simpleModal(由我们这里的一个人创建)来获取更大的内容。
标签: javascript qtip