Monday, May 20, 2024
143
rated 0 times [  149] [ 6]  / answers: 1 / hits: 115751  / 9 Years ago, sat, november 7, 2015, 12:00:00

I have a problem with bootstrap's tooltip : When I click on a button, tooltip stays even if is the cursor is outside of the button. I have looked into the manual - Bootstrap's tooltip and if I'm clicking on the buttons, I see the same problem. Is there any solution to fix this? Just tried in latest FF, IE.


More From » twitter-bootstrap

 Answers
14

This is because trigger is not set. The default value for trigger is 'hover focus', thus the tooltip stay visible after a button is clicked, until another button is clicked, because the button is focused.



So all you have to do is to define trigger as 'hover' only. Below the same example you have linked to without persisting tooltips after a button is clicked :



$('[data-toggle=tooltip]').tooltip({
trigger : 'hover'
})


the doc example in a fiddle -> http://jsfiddle.net/vdzvvg6o/


[#64478] Wednesday, November 4, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terrellhunterm

Total Points: 82
Total Questions: 109
Total Answers: 98

Location: Vietnam
Member since Sun, Oct 18, 2020
4 Years ago
;