开发者

disable jQuery qTip mouse events

开发者 https://www.devze.com 2023-04-11 12:51 出处:网络
How can I keep qTip from automatically showing and hiding the t开发者_如何学编程ooltips on mouseenter mouseleave events?As per the docs, you can register for the \"beforeShow\" event and returning fal

How can I keep qTip from automatically showing and hiding the t开发者_如何学编程ooltips on mouseenter mouseleave events?


As per the docs, you can register for the "beforeShow" event and returning false will stop the tooltip from showing.

So something along the lines of this

$("your jquery selector").qtip({ api: { beforeShow: function(event) { return false; } } });


You can specify the events that will cause the tooltip to hide in the hide option:

$('#tooltip').qtip({     
   hide: {
      when: 'mouseenter mouseleave'
   }
});

or you can try setting the when attribute in the show option to false:

$('#tooltip').qtip({     
   show: {
          ready: false, /* Don't show the tooltip once its ready */
          when: false /*  Prevents the tooltip from showing for any event */  
   }
});


This is what I have and works. It disables mouse events and tool tips is trigger by qtip("show")

$(document).ready(function() {
  $('#link1').qtip({
    content: 'This is a tool tip',
    show: {
      event: false
    },
    hide: {
      event:false
    }
  })

  $('#link1').qtip("show");
});
0

精彩评论

暂无评论...
验证码 换一张
取 消