Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jQuery.widget: Adding example for _setOption().

  • Loading branch information...
commit 96ccdbd2e67855b26726d03b30daf1865c836d70 1 parent d9b092f
@tjvantoll tjvantoll authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 entries/jQuery.widget.xml
View
14 entries/jQuery.widget.xml
@@ -290,6 +290,20 @@ _setOptions: function( options ) {
<argument name="value" type="Object">
<desc>A value to set for the option.</desc>
</argument>
+ <example>
+ <desc>Update a widget's element when its <code>height</code> or <code>width</code> option changes.</desc>
+ <code><![CDATA[
+_setOption: function( key, value ) {
+ if ( key == "width" ) {
+ this.element.width( value );
+ }
+ if ( key == "height" ) {
+ this.element.height( value );
+ }
+ this._super( key, value );
+}
+]]></code>
+ </example>
</method>
<method name="_on">
<desc>
Please sign in to comment.
Something went wrong with that request. Please try again.