Skip to content

Commit 53007d1

Browse files
committed
jQuery.widget: Adding example for _on().
1 parent 96ccdbd commit 53007d1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

entries/jQuery.widget.xml

+10
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,16 @@ _setOption: function( key, value ) {
325325
A map in which the string keys represent the event type and optional selector for delegation, and the values represent a handler function to be called for the event.
326326
</desc>
327327
</argument>
328+
<example>
329+
<desc>Prevent the default action of all links clicked within the widget's element.</desc>
330+
<code><![CDATA[
331+
this._on( this.element, {
332+
"click a": function( event ) {
333+
event.preventDefault();
334+
}
335+
});
336+
]]></code>
337+
</example>
328338
</method>
329339
<method name="_off">
330340
<desc>

0 commit comments

Comments
 (0)