<button type="button" class="btn" data-placement="bottom" rel="tooltip" title="Info" data-toggle="modal" data-target="#myModal"></button>
Got modal and tooltip in 1 button. After modal is being closed, tooltip is being shown. I don't want that. I'm trying to achieve with this code:
$('[rel="tooltip"]').tooltip('manual');
if (!$('#myModal').is(':visible')) {
$('[rel="tooltip"]').tooltip('hide');
}
Whats wrong with this code?
Triggering the tooltip that way holds the focus after the modal pops up, this code should work for you.
$(document).ready(function(){
$('[rel="tooltip"]').tooltip({trigger: "hover"});
});
actually this is not the best approach to achieve what you want you can do it in another way check this fiddle
just wrap your btn
in a span which will trigger the modal
<span data-toggle="modal" data-target="#myModal">
<button type="button" class="btn btn-primary" data-placement="bottom" title="Info" data-toggle="tooltip">Launch demo modal</button>
</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With