Have been building a site for a client and am using pagination for loading multiple CMS items. On the first page the interactions work great, however, when I click the next pagination button all the interactions stop working.
If you scroll down the page, you’ll see the added attribute of ‘reset interactions’, but they do give you a warning:
Warning: When using this attribute, all interactions that have an Initial State will be restored to it, use with caution to avoid unexpected UX behaviors.
So I had to build animations on the page in question with 90% of them not using ‘Initial State’. This isn’t too muhc of a bother, as you just set the style of each element to reflect the starting position, thus not needing to animate using Initial State. I can share a link to a duplicate I made of a client site which has some peeled back code etc to avoid infringment:
So none of the interactions have ‘Initial state’ set, except the scrolling banner on the CMS items like ‘selling fast’ and ‘sold out’ . So when I click the ‘+show more’ button it loads the next CMS items in the pagination and restarts ALL animations with the ‘Initial State’ set. I.E ONLY the scrolling banners will reset.
It’s not a huge issue if you take into consideration that all other animations must be built at their starting locations/states to avoid them popping up unexpectedly. So far it’s worked fine haha
Hey, thank you for the feedback and your efforts! I could solve it in a different way. Unfortunately, I had to think of a completely different solution. But it works now
Hello, newbie here. How do I use the method you mentioned? What element does the attribute get added to? And I don’t understand the “Where? Add to an element with fs-cmsload-element = “list”” part in the link you sent.
I’m looking for a solution since 4 hours. I have 3 nested CMS Collections and used the Finsweet Tutorials for this. So far so good. But then, I wanted to click on a single item from collection 3 to show the multi-reference items of collection 4. Interaction just doesn’t work…
Somehow the finsweet solution resetix did not work for me so here is what I did with the help of good ol’ChatGPT. So I asked the following prompt:
“How do I do a load more button for collection items in Webflow without using Finsweet?”
This is what it answered:
Design Your Collection List and Load More Button : Set up your collection list and design it as you normally would. Place a button at the bottom of the collection list to serve as your “Load More” button.
Add Custom Code : You’ll need to add custom JavaScript to handle the “Load More” functionality. Here’s an example of how you might structure this code:
<!-- Add jQuery if not already added -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
// Set the number of items to show initially and the number to load each time
var itemsToShow = 6;
var itemsPerLoad = 3;
var collectionList = $(".your-collection-list");
var loadMoreButton = $(".load-more-button");
var allItems = collectionList.find(".collection-item");
var hiddenItems = allItems.slice(itemsToShow);
hiddenItems.hide();
loadMoreButton.on("click", function() {
var visibleItems = collectionList.find(".collection-item:visible");
var nextItems = hiddenItems.slice(0, itemsPerLoad);
if (nextItems.length === 0) {
loadMoreButton.hide();
} else {
nextItems.fadeIn();
}
hiddenItems = hiddenItems.slice(itemsPerLoad);
// Scroll to the top of the newly loaded items
$("html, body").animate({
scrollTop: collectionList.offset().top
}, 300);
});
});
</script>
Based on the code above, you need to replace the following classes:
.your-collection-list (the class of the collection list)
.load-more-button (the class of the load more button. In my case, I used and Id here – #loadMoreButton
.collection item (the class of the collection item)
I’m not an expert on js and only rely on chatGpt, but I think this does the job for me.
I think Finsweet is a good solution, but in my case I could not make the image appear on hover via the mouse over element interaction.
Here is a copy of a website that I am building now with that piece of code in it. Hope this works for you also and others who will read this. -
hi,
can u also help me with my site, I have serval interaction on my site it all work fine but when I switch pages up nothing works at all. I have been looking for the solution but nothing works. this is my college project it should be submitted till June 11. can u please help me ?
( it not finished yet)