本文介绍了jQueryUI工具提示小部件,在单击时显示工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何修改新的jQueryUI的工具提示小部件以在文档上某些元素的click事件上打开工具提示,而其他工具仍在mouseover事件上显示其提示.在单击打开的情况下,应通过单击文档上的其他位置来关闭工具提示.
How the new jQueryUI's tooltip widget can be modified to open the tooltip on click event on certain element's on document, while the others are still showing their tootip on mouseover event. In click-open case the tooltip should be closed by clicking somewhere else on the document.
这有可能吗?
推荐答案
jsfiddle http://jsfiddle.net/bh4ctmuj/225/
jsfiddlehttp://jsfiddle.net/bh4ctmuj/225/
这可能会有所帮助.
<!-- HTML -->
<a href="#" title="Link Detail in Tooltip">Click me to see Tooltip</a>
<!-- Jquery code-->
$('a').tooltip({
disabled: true,
close: function( event, ui ) { $(this).tooltip('disable'); }
});
$('a').on('click', function () {
$(this).tooltip('enable').tooltip('open');
});
这篇关于jQueryUI工具提示小部件,在单击时显示工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!