I have the following code being run if an iphone/ipad/ipod is detected:
$('.tooltip-trigger').tooltip({offset: [20, -110],relative:true, events: { def: 'touchstart,blur'} });
I have got the initial touch working instead of on hover by declaring def:'touchstart', however the boxes do not close and calling another touchstart like def: 'touchstart,touchstart' does not work. Neither does def: 'toggle' which seems logical to me.
Any ideas?
I resolved this by placing a close button on the tooltip for smartphones and tablets only
I did the same thing. Here's how:
My tooltip function looks like this:
Finally I added this:
Seems to work.
I tried adding a hide: option to the tooltip function to autohide after 10s which worked but then you could not open that tooltip again until a different one was open.
user2956826 answer follows the jqueryui recommendation here - which is:-
...detailed here
However, the HTML special characters included seemed to be displayed literally in the browser and I needed to replace them with non-html equivalents within the double quotes. There is also (trivially) a missing single-quote in the same line around align=right so I have for eg.
well, just ran in the same issue, but had one more requirement - since I have multiple tooltips I need at least to close opened tooltips while a new one is opened. Came with this easy implementation, maybe will help somebody out
I could not replicate the solution by Bill Nobes and nlsbshtr, pressing the 'close' link also navigated to the top of the page. I changed it the a slightly easier solution.
This is based on jQuery and the Modernizr.touch function to detect if we are on a touch device. It uses the standard title tag and it closes the opened tooltip using the recommended close-method on click.
replace
.tooltip-trigger
with the class of your choice.For me, this works:
Add css:
.ui-tooltip{cursor:pointer;}
Add jquery:
After that, tooltips will close, when you click on it, even on iPads.