gpt4 book ai didi

javascript - 一段时间后如何隐藏 qtip 工具提示?

转载 作者:行者123 更新时间:2023-11-29 20:25:35 25 4
gpt4 key购买 nike

我正在使用 qtip ( http://craigsworks.com/projects/qtip/ ) 制作工具提示。现在我需要在按下按钮时显示工具提示,并在 3 秒后隐藏工具提示。我当前的代码不工作,工具提示有时会消失,有时会保留...

var self = $("#email");
self.qtip({
content: error,
tip: true,
position: { corner: { target: 'rightMiddle', tooltip: 'leftMiddle' } },
style: 'error',
show: { when: false, ready: true },
hide: { when: { event: 'mousemove' }, delay: 2000, effect: function () { self.qtip("destroy"); } }
});

最佳答案

@newbie,但回应是整理代码,这可能就是问题所在。例如,用“this”替换变量“self”的名称。

$("#email").qtip( { 
content: error,
tip: true,
position: { corner: { target: 'rightMiddle', tooltip: 'leftMiddle' } },
style: 'error',
show: { when: false, ready: true },
hide: { when: { event: 'mousemove' },
delay: 2000,
effect: function() { $(this).qtip("destroy"); }
}
});

关于javascript - 一段时间后如何隐藏 qtip 工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1340253/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com