How to make qTip2 to work jQuery just a click?

I am using the qTip jQuery plugin and want the tooltip to appear only when a link or button is clicked. I found several methods that should work, but don't seem to work in practice. Here is jsFiddle where I tried two different methods: http://jsfiddle.net/dqkzV/2/ . There is also another answer here that claims to work, but doesn't seem to work for me (2nd method on my jsFiddle): jQuery onClick hint? . With both methods that I tried, a tooltip still appears when you hover over the mouse when it should only display when clicked.

+4
source share
1 answer

Your first method simply adds qTip to <body> when you click the .clickme button, although I don’t understand why it does not seem to be added, and then sometimes appears when you hover over it.

The second method uses the syntax from qTip 1.0 , but you included qtip 2 as a library in the fiddle. qTip 2 show API is very different.

The following should show a tooltip when you click a button.

JavaScript (jQuery)

 $('.clickme').qtip({ content: 'Hello 2nd Test', show: 'click' }); 
+9
source

Source: https://habr.com/ru/post/1385445/


All Articles