Combine Two Collections (Jquery + JsFiddle)

Here is the jquery to combine two collection lists - i.e. two multi-image galleries (if you need more than 25 images in your gallery)

var combinedLists = "";
$(".collection-list-list").each(function () { 
    combinedLists += $(this).html();
});

$(".collection-list-wrapper").slice(1).remove();
$(".collection-list-list").html(combinedLists );

Here’s a jsfiddle of it in action- https://jsfiddle.net/diarmuids/g0ytub1o/

1 Like

FYI: As of jQuery 3.4 , the :first pseudo-class is deprecated. Remove it from your selectors and filter the results later using .first() .

https://api.jquery.com/first-selector/

1 Like

Thanks for the heads up - just updated the code now.

1 Like