To properly load a Calendly popup script after the page has fully loaded in Webflow, you need to defer the script execution until everything, including assets, has finished loading.
load
event listener, ensuring it doesn’t execute until the full page—including images—is loaded.Example:
window.addEventListener('load', function() { ... });
block.window.onload
event.<body>
Embed, include the same window.addEventListener('load', …)
usage.Use this inside the <body>
Embed or Footer Custom Code:
window.addEventListener('load', function() { var calendlyLink = document.querySelector('.calendly-btn'); if (calendlyLink) { calendlyLink.addEventListener('click', function(e) { e.preventDefault(); Calendly.initPopupWidget({ url: 'https://calendly.com/YOUR_URL' }); }); }});
'https://calendly.com/YOUR_URL'
with your actual Calendly link.calendly-btn
, or adjust the selector accordingly.<script src="https://assets.calendly.com/assets/external/widget.js" type="text/javascript" async></script>
async
helps the script load asynchronously without blocking the rest of the page.To defer loading a Calendly popup script in Webflow until the page is fully loaded, use window.addEventListener('load', …)
to wrap your script and only bind the popup logic afterward. Add the Calendly library script in the Footer and trigger the popup via a button with a click listener.