Jquery UI 工具提示.设置超时并设置悬停事件.鼠标悬停时冻结工具提示 [英] Jquery UI tooltip. Set timeout and set hover events. Freeze tooltip on mouseover
本文介绍了Jquery UI 工具提示.设置超时并设置悬停事件.鼠标悬停时冻结工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用谷歌搜索了大约 2 天,但不知道如何为 http://api 设置超时.jqueryui.com/tooltip/ ???
I've googled about 2 days and can't figure out how to set timeout for http://api.jqueryui.com/tooltip/ ???
也许我应该使用 jquery hoverIntent ?
Maybe i should use jquery hoverIntent ?
这是我的代码
$('*[class*="help_"]').tooltip({
open: function(e,o){
$(o.tooltip).mouseover(function(e){
$('*[class*="help_"]').tooltip('open');
});
$(o.tooltip).mouseout(function(e){
});
},
close: function(e,o) {}
});
推荐答案
我也找了一个类似的解决方案,正常显示工具提示,但是当鼠标悬停在工具提示上时它应该停留(工具提示的内容是一些按钮).
I also looked for a similar solution, showing the tooltip normally, but when mouseover on the tooltip it should stay (the content of a tooltip is some buttons).
我不想要一个完整的框架(qtip)来做到这一点,我已经在我的网站上使用 jqUI.
I don't want a whole framework(qtip) to do just that, i'm already using jqUI all over my site.
所以我这样做了:
$( document ).tooltip({
show: null, // show immediately
items: '.btn-box-share',
hide: {
effect: "", // fadeOut
},
open: function( event, ui ) {
ui.tooltip.animate({ top: ui.tooltip.position().top + 10 }, "fast" );
},
close: function( event, ui ) {
ui.tooltip.hover(
function () {
$(this).stop(true).fadeTo(400, 1);
//.fadeIn("slow"); // doesn't work because of stop()
},
function () {
$(this).fadeOut("400", function(){ $(this).remove(); })
}
);
}
});
这篇关于Jquery UI 工具提示.设置超时并设置悬停事件.鼠标悬停时冻结工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文