问题
I've used tooltip
for a <div>
It will hide()
after couple of seconds
If I'll mouse over it's trigger after it
for the first time it will not appear
only after I move the mouse over it the second time it will appear
I used onShow
event for binding and used window.setTimeOut
is it a problem in the tooltip or in jquery?
something like this:
$(document).ready(function() {
x = $("button").tooltip({
api: true,
position: "center right",
onShow: function() {
var hid = function() {
x.getTip().hide();
};
window.setTimeout(hid, 2000);
}});
x.show();
});
demo
回答1:
well, I've fixed it: answer here:
$(document).ready(function() {
x = $("button").tooltip({
api: true,
**effect:"fade"**,
position: "center right",
onShow: function() {
var hid = function() {
**x.hide();**
};
window.setTimeout(hid, 2000);
}});
x.show();
});
http://jsfiddle.net/vKa5Z/5/
来源:https://stackoverflow.com/questions/6218633/jquery-tools-tooltip-doesnt-appear-in-first-try-after-hide