is there a way to manually open close the jquery ui tooltip? I just want it to react to a click event toggling on/off. You can unbind all mouse events and it will rebind them when calling .tooltip('open'), even though that should not initialize or set events imo, since if you try to run .tooltip('open') without initializing, it complains loudly about not being initialized.
相关问题
- Setting 'option' on jqueryui DatePicker cl
- react-vega and react-vega tooltips
- CSS: element should get max-width before breaking
- jquery-ui progressbar not showing
- JQuery - ToggleClass/AddClass/RemoveClass
相关文章
- jQuery UI Sortable: Scroll entire page as well as
- Set the z-index value of a jQuery autocomplete inp
- How to get a Component's own ElementRef for re
- jQuery UI Sortable animations
- jQuery accordion: prevent pane from opening/cancel
- jQuery UI datepicker - Trying to capture click eve
- How do use bootstrap tooltips with React?
- Disabling ctrl-click on jquery ui selectable
If you want to just unbind the events and woudn't like to make your own custom tooltip.
mouseout blocks the tooltop disappearing by moving the mouse cursor
focusout blocks the tooltop disappearing by keyboard navigation
The tooltip have a disable option. Well i used it and here is the code:
jltwoo, can I suggest to use two different boolean switches to enable auto-open and auto-close? With this change your code will look like this:
In this way, initializing the tooltip as:
it shows by itself when the mouse is over the element but you have to manually close it.
If you want to manually control both open and close actions, you can simply use:
Some compilation from other SO questions.
Example Show tooltip on
hint
click, and hide tooltip on elsevere clickRelated to my other comment, I looked into the original code and achieved manual open/close by extending the widget and adding a autoHide option with version JQuery-UI v1.10.3. Basically I just remove the mouse listeners that were added in _create and the internal _open call.
Edit: Separated autoHide and autoShow as two separate flags as suggested by @MscG
Demo Here: http://jsfiddle.net/BfSz3/
Now when you initialize you can set the tooltip to manually show or hide by setting autoHide : false:
And just directly perform standard open/close calls in your code as needed elsewhere
A simple hotfix, until I have the time to do official pull request, this will have to do.