覆盖 jQueryUI 对话框默认选项 [英] Override jQueryUI dialog default options

查看:25
本文介绍了覆盖 jQueryUI 对话框默认选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够创建模态对话框,例如

I want to be able to create modal dialogs, with, for example

close: function() {
    $(this).remove();
}

默认选项,不需要在创建对话框时指定那些,但以某种方式在一个地方覆盖这些参数.

default option, without need to specify those on dialog creation, but somehow override those parameters on one place.

这可能吗?

推荐答案

我也需要覆盖默认选项,我花了一些时间才弄清楚 jQuery UI 1.8:

I, too, needed to override default options and took me a while to figure out for jQuery UI 1.8:

$.extend($.ui.dialog.prototype.options, {
    modal: true,
    resizable: false,
    draggable: false
});

上面的代码将允许您在对话框选项顶部放置任何内容.上述方法应该适用于大多数 UI 组件(它还可以让您对现有的功能进行原型设计,或添加到).

The above code will allow you to drop anything on top of the dialog options. The above method should work for most UI components (it will also let you prototype over the functions that exist, or add to).

这篇关于覆盖 jQueryUI 对话框默认选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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