javascript - Use Bootstrap tooltips only if touch events are supported? -
i'm using bootstrap tooltips on site:
$('body').tooltip({ selector: '.help, .searchicons li, .user-prefs, .colour' }); the problem don't work brilliantly on touch devices, when attached elements have specific touch events attached.
is there way can disable them on touch elements?
you can detect touch capability , create tooltip if touch not enabled.
var is_touch_device = 'ontouchstart' in document.documentelement; if (!is_touch_device) { $('body').tooltip({ selector: '.help, .searchicons li, .user-prefs, .colour' }); }
Comments
Post a Comment