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

查看:98
本文介绍了覆盖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天全站免登陆