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;
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" );
]]>