开发者

How to close boxy window on press ESC key?

开发者 https://www.devze.com 2023-01-31 18:17 出处:网络
I\'m using http:开发者_Python百科//onehackoranother.com/projects/jquery/boxy/ How to close boxy window on press ESC key?if (this.options.closeable) {

I'm using http:开发者_Python百科//onehackoranother.com/projects/jquery/boxy/

How to close boxy window on press ESC key?


        if (this.options.closeable) {
            jQuery(document.body).bind('keypress.boxy', function(evt) {
                var key = evt.which || evt.keyCode;
                if (key == 27) {
                    self.hide();
                    jQuery(document.body).unbind('keypress.boxy');
                }
            });
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消