afterEnter()
hook to manually reinitialize Webflow interactions by calling Webflow.require('ix2').init();
.Webflow.destroy();
before reinitializing to prevent duplicates, and call Webflow.ready();
for other components like forms and sliders.When using barba.js (v2) for transitions in a Webflow site, Webflow interactions may stop working because Webflow requires a full page reload to initialize its interactions. Barba.js prevents that by using PJAX to load pages via AJAX, so Webflow’s default interaction system doesn't reinitialize.
Webflow.require
APIWebflow.require('ix2').init();
afterEnter
or after
hook.afterEnter()
or after()
lifecycle hook.Webflow.destroy();
(optional but helps avoid interaction duplication if needed)Webflow.require('ix2').init();
to restart interactionsWebflow.ready();
if forms or other components need to reinitExample placement in Barba v2:
afterEnter()
callback:Webflow.destroy();
Webflow.require('ix2').init();
Webflow.ready();
Webflow.ready();
often helps.To make Webflow interactions work with Barba.js (v2), manually reinitialize them after each page transition:
Webflow.require('ix2').init();
inside Barba’s afterEnter()
hook.Webflow.destroy();
before that to clear old interactions.Webflow.ready();
if other Webflow components (forms, sliders) are not behaving correctly.This ensures interactions behave as expected after dynamic transitions.