简体   繁体   English

即使鼠标仍位于元素上方,有时仍会隐藏jquery工具提示

[英]Hide jquery tool-tip after sometime, even if the mouse is still over the element

I want that the tooltip should hide automatically after few seconds.Even if the mouse is over the element, still the tooltip must hide after sometime. 我希望工具提示会在几秒钟后自动隐藏。即使鼠标悬停在元素上,工具提示仍必须在一段时间后隐藏。 I am using the jquery tooltip pluggin. 我正在使用jquery工具提示插件。

Add setTimeout to open event: setTimeout添加到open事件:

$( '#field' ).tooltip(
  open: function( event, ui ) {
    setTimeout(function(){ 
      $( '#field' ).tooltip( "close" );
    }, 3000);
  })
;

fiddle 小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM