I'm using Bootstrap tooltips on my site:
$('body').tooltip({
selector: '.help, .searchicons li, .user-prefs, .colour'
});
The only problem is that they don't work brilliantly on touch devices, when they are attached to elements that also have specific touch events attached.
Is there a way that I can disable them on touch elements?
You can detect for touch capability and then only create the tooltip if touch is not enabled.
var is_touch_device = 'ontouchstart' in document.documentElement;
if (!is_touch_device) {
$('body').tooltip({
selector: '.help, .searchicons li, .user-prefs, .colour'
});
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.