jQueryUI 工具提示小部件,用于在单击时显示工具提示 [英] jQueryUI tooltip Widget to show tooltip on Click

查看:35
本文介绍了jQueryUI 工具提示小部件,用于在单击时显示工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何修改新的 jQueryUI 的工具提示小部件以在文档上的某些元素的单击事件上打开工具提示,而其他元素仍然在鼠标悬停事件上显示它们的工具提示.在单击打开的情况下,应通过单击文档上的其他位置来关闭工具提示.

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.

这可能吗?

推荐答案

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 工具提示小部件,用于在单击时显示工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆