Allowing only one instance of twitter bootstrap tooltip -
is possible limit twitter bootstrap's tooltip show 1 instance? example:
<div class="d1" title="d1"> <div class="d2" title="d2"> <div class="d3" title="d3"/> </div> </div> $('.d1').tooltip({delay: {show: 1500, hide: 0}, html: true, container: '.content'}); $('.d2').tooltip({delay: {show: 1500, hide: 0}, html: true, container: '.content'}); $('.d3').tooltip({delay: {show: 1500, hide: 0}, html: true, container: '.content'}); the problem on mouse on div d3 tooltips shown. there way prevent other tooltips showing up?
i made fiddle possible work around. defining new "lone-tooltip" user can achieve child element's tooltip shown on own hiding other tooltips.
this works using bootstrap's "shown.bs.tooltip", did not work "show.bs.tooltip"...
$('[data-toggle="tooltip"]').tooltip({ container:'body', }) $('[data-toggle="lone-tooltip"]').tooltip({ container:'body' }) $('[data-toggle="lone-tooltip"]').on('shown.bs.tooltip',function(e){ $('[data-toggle="tooltip"]').not(this).tooltip('hide'); });
Comments
Post a Comment