jQuery UI对话框-自定义关闭按钮(X) [英] Jquery UI Dialog - Custom Close Button (X)

查看:522
本文介绍了jQuery UI对话框-自定义关闭按钮(X)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击标准X按钮时,我想为其设置一些自定义功能.我已经浏览了API和所有相关信息,并且在这方面完全是荒谬的.对于如此常用的软件,文档非常糟糕,而且还不合标准.

I would like to set some custom functions for when I click the standard X button. I have scrolled through the API and all related information and it is completely barren when it comes to this. The documentation is shockingly poor and rather sub standard for such a commonly used piece of software.

我想做的是单击X时,我希望它运行一些自定义代码.不幸的是,X按钮缺少ID,并且没有有关如何直接访问它的文档.我在这里看到了建议用户创建关闭"按钮的答案,但这似乎毫无意义,因为它已经附带了一个,而且我不希望在窗口底部但在标题中有一个关闭按钮.酒吧.

What I want to do is when the X is clicked I would like it to run some custom code. Unfortunetely the X button lacks an id and there is no documentation on how to access it directly. I have seen answers on here suggesting users to create a "Close" button but that seems rather pointless as it already comes with one and further more I don't wish to have a close button located at the bottom of the window but in the title bar.

推荐答案

尝试一下

  $(".ui-dialog-titlebar-close").click( function() {
     //some code
 });

这篇关于jQuery UI对话框-自定义关闭按钮(X)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆