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.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
The way I fixed this issue was by removing the tooltip in the click event function using the following code:
David's answer above helped to fix my problem. I had both hover and click event on the button. Firefox on MAC did behave as I wanted. That is, show tooltip when hover, do not show tooltip for click. On other browsers and OS, When I click, the tooltip appear and stay as show. Even if i move the mouse to other buttons for hover. This is what I had:
This is the fix:
I know over a year old, but I couldn't get this to work with any examples here. I've had to use the following:
This also shows the tooltip again upon hover.
I'm using bootstrap tooltip in cycle.js and none of the above worked for me.
I had to do this:
Try using
rel="tooltip"
instead ofdata-toggle="tooltip"
which worked in my case. I was usingdata-toggle="tooltip"
and also set the trigger condition as hover which didn't work in my case. When I changed my data selector, it worked.HTML Code:
JS Code //Tooltip $('.btn').tooltip({ trigger: 'hover' });
This will definitely remove the stuck tooltip.