div block as a popup and add desired content.overflow to scroll or auto.no-scroll body class and scripts for popup open/close interactions in Webflow.When creating a scrollable section within a popup in Webflow, it's important to prevent the whole site from scrolling. Here's how you can achieve that:
div block to create your popup and style it according to your needs.div that you wish to display in the popup.
overflow to scroll (or auto), enabling only the content within the section to scroll.
<style>body.no-scroll {-webkit-overflow-scrolling: none; overflow: hidden; }</style> in the Head Code section.</body> tag:```javascript
<script>
const openPopup = () => {
document.body.classList.add('no-scroll');
};
const closePopup = () => {
document.body.classList.remove('no-scroll');
};
</script>
```
openPopup().closePopup().
openPopup when the popup is triggered and closePopup when it is dismissed or closed.
To ensure only the section within a popup is scrollable, set the section to have limited height and overflow: scroll. Apply a no-scroll class to the body to prevent the entire site from scrolling. Use simple scripts linked with interactions to toggle this effect effectively.