Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make jQueryUI tooltip apply only on focus

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

like image 472
Mark W Avatar asked Nov 05 '12 13:11

Mark W


2 Answers

A bit shorter way:

$(".selector").tooltip().off("mouseover mouseout");

like image 54
lxgreen Avatar answered Nov 17 '22 15:11

lxgreen


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/

like image 15
Andrew Whitaker Avatar answered Nov 17 '22 14:11

Andrew Whitaker