Is there any way in jquery clueTip to have the escape key close a sticky tooltip?

北慕城南 提交于 2019-12-12 18:23:14

问题


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');
    }
});


来源:https://stackoverflow.com/questions/9090821/is-there-any-way-in-jquery-cluetip-to-have-the-escape-key-close-a-sticky-tooltip

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!