Welcome to the Liquify Community

Updated 3 weeks ago

Reinitializing webflow interactions?

Pretty simple question – sometimes Webflow interactions breaks when rendering an array of elements.

I'm familiar with this issue from other type of projects and am pretty sure it's because Webflow interactions need to be reinitialized. But I'm unsure of how to do so in this context.

Any help? Surely someone has done this already thanks.
J
j
J
9 comments
Hey @Jonathan Fors, you can use the follwing:
Destroy all interactions: Webflow.destroy()
Initialize the IX2 engine: Webflow.require('ix2').init()
So depending on what you're doing, you just need to call the initialization after that with JS
did that help @Jonathan Fors ?
Kinda, it’s a bit inconsistent. I need to call this after the product recommendations are loaded on the product page. Here for example: https://makebo-theme.myshopify.com/products/blue-soft-touch-case-copy?_psq=Leather&_v=1.0
Same thing when using the search module, need to reinitialize animations after the items are loaded
Hmm, you could try something like setTimeout, but that's not really clean. What are you using the Webflow interactions for? Maybe you could use GSAP and have better control over the initilization. :)
If I gotta switch to GSAP I'll prolly just drop the animations entirely for these, they're not really super important. Just quality of life stuff. Basically the add to cart button is hidden on the product cards until you hover on them, but it's totally fine if they're visible at all times as well as it's only affecting these two places
I see. I like to do these kinds of animations purely with css:
So you have your default class where you set the button 4rem down and just add :hover styling to your global styles like so:

products_item:hover .products_image-overlay {
background-color: rgba(44, 44, 44, 15);
}

products_item:hover .products_overlay-content {
transform: translate3d(0px, 0rem, 0px);
}

You just have to put a transition easing on the elements you want to animate
Good point! I often do this in other situations, not sure why I didn’t think of it for this. Thanks, I’ll go this route!
Add a reply
Sign up and join the conversation on Discord