JQuery-UI tooltip: enable only for mouseover, disable for focusin

175 Views Asked by At

Is it possible to make JQuery-UI tooltip open only on onmouseover but not on focusin event, to make it behave more like a native browser tooltip?

I tried this solution, but it didn't work:

$(document).tooltip({
    items:".jquery-tooltip",
    track:true, show:false, hide:false,
    open: function(event, ui) {
        if(event.originalEvent.type == "focusin") {
            $(document).tooltip("close");
        }
    },
    content: function() {
        return "tooltip text here";
    }
});
1

There are 1 best solutions below

0
laurt On BEST ANSWER

This works:

$(document).tooltip().off("focusin focusout");