To disable scrolling on everything except the modal div in Webflow, a custom code approach is required to manage the overflow property.
modal.
```css
<style>
body.modal-open {
overflow: hidden;
}
</style>
```
```html
<script>
document.addEventListener("DOMContentLoaded", function() {
// Select the modal by ID
var modal = document.getElementById('modal');
// Function to open the modal
function openModal() {
modal.style.display = 'block';
document.body.classList.add('modal-open');
}
// Function to close the modal
function closeModal() {
modal.style.display = 'none';
document.body.classList.remove('modal-open');
}
// Example: Open modal button click handler
document.getElementById('openModalButton').addEventListener('click', openModal);
// Example: Close modal button click handler
document.getElementById('closeModalButton').addEventListener('click', closeModal);
});
</script>
```
By adding specific CSS and JavaScript, you can effectively disable body scrolling when the modal is open while allowing interaction with the modal itself. This involves using a class on the body element to control scrolling and JavaScript to manage your modal's visibility.