Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entries/bind.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ $( "p" ).bind( "myCustomEvent", function( e, myName, myValue ) {
.fadeIn( 30 )
.fadeOut( 1000 );
});
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).trigger( "myCustomEvent", [ "John" ] );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ $( "div" ).data( "options" ).name === "John";
<example>
<desc>Get the data named "blah" stored at for an element.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
var value;

switch ( $( "button" ).index( this ) ) {
Expand Down
2 changes: 1 addition & 1 deletion entries/delay.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $( "#foo" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 );
}
]]></css>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "div.first" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 );
$( "div.second" ).slideUp( 300 ).fadeIn( 400 );
});
Expand Down
2 changes: 1 addition & 1 deletion entries/delegate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $( "body" ).delegate( "p", "myCustomEvent", function( e, myName, myValue ) {
.fadeIn( 30 )
.fadeOut( 1000 );
});
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).trigger( "myCustomEvent" );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/dequeue.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<example>
<desc>Use dequeue to end a custom queue function which allows the queue to keep going.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "div" )
.animate({ left:"+=200px" }, 2000 )
.animate({ top:"0px" }, 600 )
Expand Down
2 changes: 1 addition & 1 deletion entries/detach.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $( "p)" ).on( "click", function() {
$( this ).toggleClass( "off" );
});
var p;
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
if ( p ) {
p.appendTo( "body" );
p = null;
Expand Down
4 changes: 2 additions & 2 deletions entries/each.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<argument name="function" type="Function">
<desc>A function to execute for each matched element.</desc>
<argument name="index" type="Integer" />
<argument name="element" type="Element" />
<argument name="element" type="Element" />
</argument>
</signature>
<desc>Iterate over a jQuery object, executing a function for each matched element. </desc>
Expand Down Expand Up @@ -106,7 +106,7 @@ To do list: <span>(click here to change)</span>
<example>
<desc>Use <code>return false</code> to break out of each() loops early.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "div" ).each(function( index, element ) {
// element == this
$( element ).css( "backgroundColor", "yellow" );
Expand Down
2 changes: 1 addition & 1 deletion entries/hide.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $( "a" ).on( "click", function( event ) {
<example>
<desc>Animates all shown paragraphs to hide slowly, completing the animation within 600 milliseconds.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).hide( "slow" );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/jQuery.dequeue.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<example>
<desc>Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "div" )
.animate({ left: '+=200px' }, 2000 )
.animate({ top: '0px' }, 600 )
Expand Down
2 changes: 1 addition & 1 deletion entries/live.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ $( "p" ).live( "myCustomEvent", function( event, myName, myValue ) {
.fadeIn( 30 )
.fadeOut( 1000 );
});
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).trigger( "myCustomEvent" );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/nth-child-selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $( "ul li:nth-child(2)" ).append( "<span> - 2nd!</span>" );
<example>
<desc>This is a playground to see how the selector works with different strings. Notice that this is different from the <a href="/even/"><code>even</code></a> and <a href="/odd/"><code>odd</code></a> which have no regard for parent and just filter the list of elements to every other one. The :nth-child, however, counts the index of the child to its particular parent. In any case, it's easier to see than explain so...</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
var str = $( this ).text();
var method = $( this ).attr( "data-method" );
$( "tr" ).css( "background", "white" );
Expand Down
2 changes: 1 addition & 1 deletion entries/nth-last-child-selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $( "ul li:nth-last-child(2)" ).append( "<span> - 2nd to last!</span>" );
<example>
<desc>This is a playground to see how the selector works with different strings. </desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
var str = $( this ).text();
$( "tr" ).css( "background", "white" );
$( "tr" + str ).css( "background", "#ff0000" );
Expand Down
2 changes: 1 addition & 1 deletion entries/nth-last-of-type-selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ $( "ul li:nth-last-of-type(2)" ).append( "<span> - 2nd to last!</span>" );
<example>
<desc>This is a playground to see how the selector works with different strings. </desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
var str = $( this ).text();
$( "tr" ).css( "background", "white" );
$( "tr" + str ).css( "background", "#ff0000" );
Expand Down
2 changes: 1 addition & 1 deletion entries/prev.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $( "li.third-item" ).prev().css( "background-color", "red" );
<code><![CDATA[
var $curr = $( "#start" );
$curr.css( "background", "#f99" );
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$curr = $curr.prev();
$( "div" ).css( "background", "" );
$curr.css( "background", "#f99" );
Expand Down
2 changes: 1 addition & 1 deletion entries/remove.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ how are
<example>
<desc>Removes all paragraphs that contain "Hello" from the DOM. Analogous to doing <code>$("p").filter(":contains('Hello')").remove()</code>.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).remove( ":contains('Hello')" );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/removeAttr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ console.log( "onclick property: ", $element[ 0 ].onclick );
<code><![CDATA[
(function() {
var inputTitle = $( "input" ).attr( "title" );
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
var input = $( this ).next();

if ( input.attr( "title" ) === inputTitle ) {
Expand Down
2 changes: 1 addition & 1 deletion entries/replaceWith.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $( "div.third" ).replaceWith( $( ".first" ) );
<example>
<desc>On click, replace the button with a div containing the same word.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( this ).replaceWith( "<div>" + $( this ).text() + "</div>" );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/show.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $( "#clickme)" ).on( "click", function() {
<example>
<desc>Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).show( "slow" );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/slideToggle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $( "#clickme)" ).on( "click", function() {
<example>
<desc>Animates all paragraphs to slide up or down, completing the animation within 600 milliseconds.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).slideToggle( "slow" );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/slideUp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Click me!
<example>
<desc>Animates the parent paragraph to slide up, completing the animation within 200 milliseconds. Once the animation is done, it displays an alert.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( this ).parent().slideUp( "slow", function() {
$( "#msg" ).text( $( "button", this ).text() + " has completed." );
});
Expand Down
4 changes: 2 additions & 2 deletions entries/toggle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ $( "button" ).on( "click", function() {
<example>
<desc>Animates all paragraphs to be shown if they are hidden and hidden if they are visible, completing the animation within 600 milliseconds.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).toggle( "slow" );
});
]]></code>
Expand All @@ -126,7 +126,7 @@ $( "button)" ).on( "click", function() {
<desc>Shows all paragraphs, then hides them all, back and forth.</desc>
<code><![CDATA[
var flip = 0;
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "p" ).toggle( flip++ % 2 === 0 );
});
]]></code>
Expand Down
2 changes: 1 addition & 1 deletion entries/unwrap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<desc>Wrap/unwrap a div around each of the paragraphs.</desc>
<code><![CDATA[
var pTags = $( "p" );
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
if ( pTags.parent().is( "div" ) ) {
pTags.unwrap();
} else {
Expand Down
2 changes: 1 addition & 1 deletion entries/val.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ $( "input[type=text].tags" ).val(function( index, value ) {
<example>
<desc>Set the value of an input box.</desc>
<code><![CDATA[
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
var text = $( this ).text();
$( "input" ).val( text );
});
Expand Down
2 changes: 1 addition & 1 deletion entries/visible-selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$( "div:visible" ).on( "click", function() {
$( this ).css( "background", "yellow" );
} );
$( "button)" ).on( "click", function() {
$( "button" ).on( "click", function() {
$( "div:hidden" ).show( "fast" );
} );
]]></code>
Expand Down