I'm trying to control the automatic opening and closing of a jQuery Tooltip.
How do I test to see if the current status of a tooltip is open?
I'm using the most recent versions of everything.
Thanks!
You can try by checking if there are any classes with ui-tooltip
.
$(".ui-tooltip").length
Or, alternatively, you can use the API to check if it is open. You can set a flag and check using:
$(".selector").on("tooltipopen", function(event, ui) {
$(this).data("tooltip", true);
});
$(".selector").on("tooltipclose", function(event, ui) {
$(this).data("tooltip", false);
});
To know the current status of the tooltip, you can use this:
$(".selector").data("tooltip");
It returns true
if open, and false
if closed. Hope this helps...
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