Is there any way in jquery clueTip to have the esc

2019-07-12 16:44发布

问题:

i am using jquery cluetip and it works great. I have it in sticky mode so i can hover over the tooltip and click on links, etc.

The one gap i have is that its a bit annoying to have to mouse click on the uppoeer right to close the cluetip . Is there anyway to simply hit the escape key and have the close the cluetip? I would expect that behavior to come out of the box but i dont see it.

回答1:

You can try something like this.

$(document).keydown(function(e) {
    // ESCAPE key pressed
    if (e.keyCode == 27) {
        //Code here to close the tooltip
        $(document).trigger('hideCluetip');
    }
});