1

在 jquery ui 1.7.* 中,我曾经这样做:

 $.extend($.ui.slider.defaults,{object with defaults});

在 1.8 中它不起作用。

在 1.8 中设置默认值的标准方法是什么?

4

1 回答 1

3

通过jQuery UI 1.8 升级指南$.ui.foo.defaults被移至$.ui.foo.prototype.options.

因此,对于您的示例,您可以通过以下方式设置所有滑块实例的默认值:

$.extend($.ui.slider.prototype.options, { object with defaults });
于 2011-03-04T02:23:24.223 回答