diff --git a/categories.xml b/categories.xml index 513b5459..d5c9d917 100644 --- a/categories.xml +++ b/categories.xml @@ -510,6 +510,15 @@ var files = event.originalEvent.dataTransfer.files;
]]> + + Aspects of the API that were changed in the corresponding version of jQuery. New .uniqueSort() method performance improvements in manipulation, fixes for .outerWidth( true ) & .outerHeight( true ) with negative margins, focus fixes.

+

As of this release, jQuery no longer relies on Sizzle.

+

Native events for focus & blur changed in IE to - respectively - focusin and focusout.

+

For more information, see the Release Notes/Changelog.

+
+ ]]>
+
diff --git a/entries/prevAll.xml b/entries/prevAll.xml index 4b5f6062..d3eeca03 100644 --- a/entries/prevAll.xml +++ b/entries/prevAll.xml @@ -50,7 +50,14 @@ $( ".last-item" ) <div class="last-item">Last</div> </div> -

because "Item 2" gets appended to the wrapper div first. To work around the issue, you may use $.uniqueSort() on the .prevAll() output first:

+

because "Item 2" gets appended to the wrapper div first. To work around the issue, you may use .uniqueSort() on the .prevAll() output first:

+

+$( ".last-item" )
+  .prevAll()
+  .uniqueSort()
+  .wrapAll( "<div class='wrapper'></div>" );
+    
+

Note that the .uniqueSort() method is only available in jQuery 3.7.0 or newer. In older versions, you will need to use $.uniqueSort() to achieve a similar effect:


 var prevSiblings = $( ".last-item" ).prevAll();
 $.uniqueSort( prevSiblings );
@@ -83,7 +90,7 @@ $( "div" ).last().prevAll().addClass( "before" );
 ]]>
   
   
-    Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without $.uniqueSort().
+    Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without .uniqueSort().
     " );
 
-var prevSiblings = $( "#container-2" )
+$( "#container-2" )
   .find( ".item" )
   .last()
-  .prevAll();
-$.uniqueSort( prevSiblings );
-prevSiblings.wrapAll( "
" ); + .prevAll() + .uniqueSort() + .wrapAll( "
" ); ]]>
+ + .uniqueSort() + + 3.7 + + Sorts a jQuery object of DOM elements, in place, with the duplicates removed. Note that this only works on jQuery objects consisting of DOM elements, not strings or numbers. + +

The .uniqueSort() function searches through a jQuery object, sorting it in document order, and removing any duplicate nodes. A node is considered a duplicate if it is the exact same node as one already in the jQuery object; two different nodes with identical attributes are not considered to be duplicates. This function only works on jQuery objects consisting of DOM elements.

+
+ + Removes any duplicate elements from the jQuery object of divs. + + + There are 6 divs in this document. +
+
+
+
+
+]]> +
+ + Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without .uniqueSort(). + " ); + +$( "#container-2" ) + .find( ".item" ) + .last() + .prevAll() + .uniqueSort() + .wrapAll( "
" ); +]]>
+ + +
1
+
2
+
3
+ + +
+
1
+
2
+
3
+
+]]> +
+ + +
diff --git a/entries2html.xsl b/entries2html.xsl index 8b06fadf..37bfdb3c 100755 --- a/entries2html.xsl +++ b/entries2html.xsl @@ -12,7 +12,7 @@ <meta charset="utf-8"> <title> demo</title> <style> </style> - <script src="https://code.jquery.com/jquery-3.6.3.js"></script> + <script src="https://code.jquery.com/jquery-3.7.0.js"></script> <script> </script>