jquery tools tooltip doesn't appear in first try after hide()

馋奶兔 提交于 2019-12-13 04:33:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!