How can I make the new JqueryUI tooltip visible only on focus
: At the moment its on focus
and on hover
. I believe this is since JqueryUI 1.9
How to make jQueryUI tooltip apply only on focus
Asked Answered
Wow such a simple question but I don't see a simple answer :( –
Wideman
A bit shorter way:
$(".selector").tooltip().off("mouseover mouseout");
+1 this worked for what I needed, the opposite, wanted them on mouse only, not focus: $(element).tooltip().off("focusin focusout"); –
Disapprobation
An add-on to the answer:
.off("mouseover mouseout");
will off all mouse over/out events. If you are using them, they will be unbind too. To make sure you are just doing off
on the tooltip's ones, do like this: $(".selector").tooltip(); var tooltipInstanceNamespace = $(".selector").tooltip("instance").eventNamespace; $(".selector").off('mouseover'+tooltipInstanceNamespace' mouseout'+tooltipInstanceNamespace);
This will off only the listeners with that tooltip instance namespace. –
Nog This isn't ideal, but it should work:
$(".selector").tooltip({
disabled: true
}).on("focusin", function () {
$(this)
.tooltip("enable")
.tooltip("open");
}).on("focusout", function () {
$(this)
.tooltip("close")
.tooltip("disable");
});
Basically, enable/open the tooltip on focusin
and disable/close on focusout
.
Example: http://jsfiddle.net/WmRuN/
I suspected something like this would be needed. Thanks. –
Exposure
Also. One problem I didn't think about with this, is that the browser inserts the standard titles on hover. :( –
Exposure
© 2022 - 2024 — McMap. All rights reserved.