I add the tipsy tooltip to divs with the .placeTaken class. The user can then drag boxes around, so I remove the class and add it to a new div instead. When this happens, I
Using $(".tipsy").remove();
seems to do the trick since a div with a tipsy
class is appended to the body of the doc when the tooltip is shown.
Just be sure you don't use a tipsy
class elsewhere (i.e. call your tooltip's something like toolTip
instead)
If you don't want the tipsy to show anymore just use .tipsy('disable')
on the element.
If you are using trigger: manual
and you want to hide it you can just remove the .tipsy
div on the body.
There's also disable
enable
and toggleEnabled
I saw this question after Googling a situation to disable Tipsy when on a mobile device due to complexities with the touch/click event, specifically on iPads.
The solution I decided to implement was adding a small test at the top of the jquery.tipsy.js file.
To disable Tipsy on touch (mobile) devices: var deviceAgent = navigator.userAgent.toLowerCase();
var isTouchDevice = Modernizr.touch ||
(deviceAgent.match(/(iphone|ipod|ipad)/) ||
deviceAgent.match(/(android)/) ||
deviceAgent.match(/(iemobile)/) ||
deviceAgent.match(/iphone/i) ||
deviceAgent.match(/ipad/i) ||
deviceAgent.match(/ipod/i) ||
deviceAgent.match(/blackberry/i) ||
deviceAgent.match(/bada/i));
function Tipsy(element, options) {
this.$element = $(element);
this.options = options;
this.enabled = !isTouchDevice;
this.fixTitle();
};
See: The best way to detect if user agent supports touch
Easier way im using:
$('body').find('.tipsy').each(function(){
$(this).remove();
});
I recently had this issue, here's how I resolved it:
Use this to set the original-title attribute to 'stop':
$('.myElement').attr('original-title','stop');
Then, in jquery.tipsy.js, change the code to the following:
...
} else if (typeof opts.title == 'function') {
title = opts.title.call(this);
}
if (title != 'stop') { //line 32
...
...
} //line 62
...
In my release (0.1.7) the added code starts at line 32 and ends bracket at line 62. Tipsy should see that your title attribute equals 'stop' and wont try to open the tooltip.
Also, this spits out some error to the console. It doesn't make any difference, but if you want to get rid of it, add this at line 73 (after adding previous code)
try { tip.remove(); } catch(err){}
POW
$("#"+dropFromId)[0].setAttribute('original-title', '')