From 375a6cb9ded0db71bec44db67a4279cc6b6c2048 Mon Sep 17 00:00:00 2001 From: cjbonn2005 Date: Thu, 4 May 2023 18:02:58 -0400 Subject: [PATCH] All: Fix event selectors --- entries/ajaxComplete.xml | 4 ++-- entries/ajaxSend.xml | 2 +- entries/animate.xml | 22 +++++++++++----------- entries/animated-selector.xml | 2 +- entries/clearQueue.xml | 4 ++-- entries/css.xml | 4 ++-- entries/detach.xml | 2 +- entries/each.xml | 2 +- entries/fadeIn.xml | 4 ++-- entries/fadeOut.xml | 10 +++++----- entries/fadeTo.xml | 4 ++-- entries/height.xml | 6 +++--- entries/hide.xml | 8 ++++---- entries/html.xml | 2 +- entries/index.xml | 2 +- entries/is.xml | 8 ++++---- entries/jQuery.fx.interval.xml | 2 +- entries/jQuery.fx.off.xml | 2 +- entries/jQuery.getScript.xml | 2 +- entries/jQuery.queue.xml | 6 +++--- entries/jQuery.sub.xml | 2 +- entries/jQuery.xml | 4 ++-- entries/off.xml | 4 ++-- entries/parents.xml | 2 +- entries/queue.xml | 4 ++-- entries/replaceWith.xml | 2 +- entries/show.xml | 6 +++--- entries/slideDown.xml | 2 +- entries/slideToggle.xml | 4 ++-- entries/slideUp.xml | 2 +- entries/stop.xml | 6 +++--- entries/toggle.xml | 2 +- entries/toggleClass.xml | 2 +- entries/triggerHandler.xml | 4 ++-- entries/unbind.xml | 4 ++-- entries/undelegate.xml | 4 ++-- entries/width.xml | 4 ++-- 37 files changed, 78 insertions(+), 78 deletions(-) diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 168865e7..0c133516 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -7,7 +7,7 @@ The string "ajaxComplete". - + @@ -33,7 +33,7 @@ $( document ).on( "ajaxComplete", function() {

Now, make an Ajax request using any jQuery method:


-$( ".trigger)" ).on( "click", function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
 } );
     
diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index ad01194e..cbd1641c 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -33,7 +33,7 @@ $( document ).on( "ajaxSend", function() {

Now, make an Ajax request using any jQuery method:


-$( ".trigger)" ).on( "click", function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
 } );
     
diff --git a/entries/animate.xml b/entries/animate.xml index 1ece251c..c4ac9e70 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -45,7 +45,7 @@

To animate the opacity, left offset, and height of the image simultaneously:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     opacity: 0.25,
     left: "+=50",
@@ -101,7 +101,7 @@ $( "li" ).animate({
     

As of jQuery version 1.4, you can set per-property easing functions within a single .animate() call. In the first version of .animate(), each property can take an array as its value: The first member of the array is the CSS property and the second member is an easing function. If a per-property easing function is not defined for a particular property, it uses the value of the .animate() method's optional easing argument. If the easing argument is not defined, the default swing function is used.

For example, to simultaneously animate the width and height with the swing easing function and the opacity with the linear easing function:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     width: [ "toggle", "swing" ],
     height: [ "toggle", "swing" ],
@@ -113,7 +113,7 @@ $( "#clickme)" ).on( "click", function() {
     

In the second version of .animate(), the options object can include the specialEasing property, which is itself an object of CSS properties and their corresponding easing functions. For example, to simultaneously animate the width using the linear easing function and the height using the easeOutBounce easing function:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     width: "toggle",
     height: "toggle"
@@ -137,7 +137,7 @@ $( "#clickme)" ).on( "click", function() {
     
     Animates a div's left property with a relative value. Click several times on the buttons to see the relative animations queued up.
     
@@ -191,7 +191,7 @@ $( "#left)" ).on( "click", function(){
 
 The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed.
     
     Animates the first div's left property and synchronizes the remaining divs, using the step function to set their left properties at each stage of the animation. 
     
     Change the color of any div that is animated.
     
     Empty the queue.
     
       Get the background color of a clicked div.
       " + color + "." );
@@ -54,7 +54,7 @@ $( "div)" ).on( "click", function() {
     
       Get the width, height, text color, and background color of a clicked div.
       
     Detach all paragraphs from the DOM
     
     To access a jQuery object instead of the regular DOM element, use $( this ). For example:
     
     Fades a red block in over the text. Once the animation is done, it quickly fades in more text on top.
     

With the element initially shown, we can hide it slowly:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).fadeOut( "slow", function() {
     // Animation complete.
   });
@@ -56,7 +56,7 @@ $( "#clickme)" ).on( "click", function() {
   
     Animates all paragraphs to fade out, completing the animation within 600 milliseconds.
     
@@ -76,7 +76,7 @@ $( "p)" ).on( "click", function() {
   
     Fades out spans in one section that you click on.
     
     Fades out two divs, one with a "linear" easing and one with the default, "swing," easing.
     " ).text( this.id ).appendTo( "#log" );
   }
@@ -121,7 +121,7 @@ $( "#btn1)" ).on( "click", function() {
   $( "#box2" ).fadeOut( 1600, complete );
 });
 
-$( "#btn2)" ).on( "click", function() {
+$( "#btn2" ).on( "click", function() {
   $( "div" ).show();
   $( "#log" ).empty();
 });
diff --git a/entries/fadeTo.xml b/entries/fadeTo.xml
index b21cda8a..c77da0d6 100644
--- a/entries/fadeTo.xml
+++ b/entries/fadeTo.xml
@@ -44,7 +44,7 @@
 </div>
 <img id="book" src="book.png" alt="" width="100" height="123">
 // With the element initially shown, we can dim it slowly:
-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).fadeTo( "slow" , 0.5, function() {
     // Animation complete.
   });
@@ -80,7 +80,7 @@ Compare to this one that won't fade.
   
     Fade div to a random opacity on each click, completing the animation within 200 milliseconds.
     
diff --git a/entries/height.xml b/entries/height.xml
index 604be8fb..3a57f603 100644
--- a/entries/height.xml
+++ b/entries/height.xml
@@ -34,13 +34,13 @@ $( document ).height();
 function showHeight( element, height ) {
   $( "div" ).text( "The height for the " + element + " is " + height + "px." );
 }
-$( "#getp)" ).on( "click", function() {
+$( "#getp" ).on( "click", function() {
   showHeight( "paragraph", $( "p" ).height() );
 });
-$( "#getd)" ).on( "click", function() {
+$( "#getd" ).on( "click", function() {
   showHeight( "document", $( document ).height() );
 });
-$( "#getw)" ).on( "click", function() {
+$( "#getw" ).on( "click", function() {
   showHeight( "window", $( window ).height() );
 });
 ]]>
diff --git a/entries/hide.xml b/entries/hide.xml
index 3db8c718..01f88a15 100644
--- a/entries/hide.xml
+++ b/entries/hide.xml
@@ -49,7 +49,7 @@ $( ".target" ).hide();
     

 // With the element initially shown, we can hide it slowly:
-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).hide( "slow", function() {
     alert( "Animation complete." );
   });
@@ -101,13 +101,13 @@ $( "button" ).on( "click", function() {
   
     Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one.
     
@@ -134,7 +134,7 @@ $( "#shower)" ).on( "click", function() {
 for ( var i = 0; i < 5; i++ ) {
   $( "
" ).appendTo( document.body ); } -$( "div)" ).on( "click", function() { +$( "div" ).on( "click", function() { $( this ).hide( 2000, function() { $( this ).remove(); }); diff --git a/entries/html.xml b/entries/html.xml index 4be065f3..0eae2f74 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -29,7 +29,7 @@ $( "div.demo-container" ).html(); Click a paragraph to convert it from html to text. On click, returns the index (zero-based) of that div in the page. A function used as a test for every element in the set. It accepts two arguments, index, which is the element's index in the jQuery collection, and element, which is the DOM element. Within the function, this refers to the current DOM element. - + @@ -63,7 +63,7 @@ $( "ul" ).on( "click", function( event ) {

You can attach a click handler to every <li> that evaluates the number of <strong> elements within the clicked <li> at that time like so:


-$( "li)" ).on( "click", function() {
+$( "li" ).on( "click", function() {
   var li = $( this ),
     isWithTwo = li.is(function() {
       return $( "strong", this ).length === 2;
@@ -177,7 +177,7 @@ $( "div" ).text( "isFormParent = " + isFormParent );
     Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red.
     An alternate way to achieve the above example using an element rather than a jQuery object. Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red.
     Cause all animations to run with less frames.
     
diff --git a/entries/jQuery.fx.off.xml b/entries/jQuery.fx.off.xml
index 3c93466d..8464f69f 100644
--- a/entries/jQuery.fx.off.xml
+++ b/entries/jQuery.fx.off.xml
@@ -21,7 +21,7 @@ var toggleFx = function() {
 };
 toggleFx();
 $( "button" ).on( "click", toggleFx );
-$( "input)" ).on( "click", function() {
+$( "input" ).on( "click", function() {
   $( "div" ).toggle( "slow" );
 } );
 ]]>
diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml
index d6e091ab..d44d1f3a 100644
--- a/entries/jQuery.getScript.xml
+++ b/entries/jQuery.getScript.xml
@@ -94,7 +94,7 @@ $.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) {
     
       Show the length of the queue.
       
       Set a queue array to delete the queue.
       Selector Context
       

By default, selectors perform their searches within the DOM starting at the document root. However, an alternate context can be given for the search by using the optional second parameter to the $() function. For example, to do a search within an event handler, the search can be restricted like so:


-$( "div.foo)" ).on( "click", function() {
+$( "div.foo" ).on( "click", function() {
   $( "span", this ).addClass( "bar" );
 });
       
@@ -62,7 +62,7 @@ $( "div.foo)" ).on( "click", function() {

Please note that although you can pass text nodes and comment nodes into a jQuery collection this way, most operations don't support them. The few that do will have an explicit note on their API documentation page.

A common use of single-DOM-element construction is to call jQuery methods on an element that has been passed to a callback function through the keyword this:


-$( "div.foo)" ).on( "click", function() {
+$( "div.foo" ).on( "click", function() {
   $( this ).slideUp();
 });
       
diff --git a/entries/off.xml b/entries/off.xml index c35a537c..fba3925c 100644 --- a/entries/off.xml +++ b/entries/off.xml @@ -46,13 +46,13 @@ function flash() { $( "div" ).show().fadeOut( "slow" ); } -$( "#bind)" ).on( "click", function() { +$( "#bind" ).on( "click", function() { $( "body" ) .on( "click", "#theone", flash ) .find( "#theone" ) .text( "Can Click!" ); }); -$( "#unbind)" ).on( "click", function() { +$( "#unbind" ).on( "click", function() { $( "body" ) .off( "click", "#theone", flash ) .find( "#theone" ) diff --git a/entries/parents.xml b/entries/parents.xml index 57b860b4..ab51cde9 100644 --- a/entries/parents.xml +++ b/entries/parents.xml @@ -82,7 +82,7 @@ function showParents() { .length; $( "b" ).text( "Unique div parents: " + len ); } -$( "span)" ).on( "click", function() { +$( "span" ).on( "click", function() { $( this ).toggleClass( "selected" ); showParents(); }); diff --git a/entries/queue.xml b/entries/queue.xml index 1a6a38ac..ec66c39f 100644 --- a/entries/queue.xml +++ b/entries/queue.xml @@ -156,7 +156,7 @@ Click here... Set a queue array to delete the queue. Paragraph. " ); On click, replace each paragraph with a div that is already in the DOM and selected with the $() function. Notice it doesn't clone the object but rather moves it to replace the paragraph. diff --git a/entries/show.xml b/entries/show.xml index 5a807d52..2ce1c4a4 100644 --- a/entries/show.xml +++ b/entries/show.xml @@ -49,7 +49,7 @@ $( ".target" ).show(); </div> <img id="book" src="book.png" alt="" width="100" height="123"> With the element initially hidden, we can show it slowly: -$( "#clickme)" ).on( "click", function() { +$( "#clickme" ).on( "click", function() { $( "#book" ).show( "slow", function() { // Animation complete. }); @@ -84,13 +84,13 @@ $( "button" ).on( "click", function() { Show the first div, followed by each next adjacent sibling div in order, with a 200ms animation. Each animation starts when the previous sibling div's animation ends. diff --git a/entries/slideDown.xml b/entries/slideDown.xml index 749a19a7..e70c81f7 100644 --- a/entries/slideDown.xml +++ b/entries/slideDown.xml @@ -30,7 +30,7 @@

With the element initially hidden, we can show it slowly:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).slideDown( "slow", function() {
     // Animation complete.
   });
diff --git a/entries/slideToggle.xml b/entries/slideToggle.xml
index f3fc2352..9a91bed8 100644
--- a/entries/slideToggle.xml
+++ b/entries/slideToggle.xml
@@ -30,7 +30,7 @@
     

We will cause .slideToggle() to be called when another element is clicked:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).slideToggle( "slow", function() {
     // Animation complete.
   });
@@ -84,7 +84,7 @@ $( "button" ).on( "click", function() {
   
     Animates divs between dividers with a toggle that makes some appear and some disappear.
     

With the element initially shown, we can hide it slowly:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).slideUp( "slow", function() {
     // Animation complete.
   });
diff --git a/entries/stop.xml b/entries/stop.xml
index ce4d5538..60062614 100644
--- a/entries/stop.xml
+++ b/entries/stop.xml
@@ -53,17 +53,17 @@ $( "#hoverme-stop-2" ).hover(function() {
     Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned.  Another option is to click several buttons to queue them up and see that stop just kills the currently playing one.
     
diff --git a/entries/toggle.xml b/entries/toggle.xml
index 199c93f6..7d74577f 100644
--- a/entries/toggle.xml
+++ b/entries/toggle.xml
@@ -51,7 +51,7 @@ $( ".target" ).toggle();
     

We will cause .toggle() to be called when another element is clicked:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).toggle( "slow", function() {
     // Animation complete.
   });
diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml
index fcb8da42..da2c894f 100644
--- a/entries/toggleClass.xml
+++ b/entries/toggleClass.xml
@@ -99,7 +99,7 @@ $( "div.foo" ).toggleClass(function() {
     
       Toggle the class 'highlight' when a paragraph is clicked.
       
diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml
index fb2da985..83b2a576 100644
--- a/entries/triggerHandler.xml
+++ b/entries/triggerHandler.xml
@@ -37,10 +37,10 @@
   
     If you called .triggerHandler() on a focus event - the browser's default focus action would not be triggered, only the event handlers bound to the focus event.