Copy link to clipboard
Copied
Is there a line of code that can disable scrolling? I have an html animation in an iframe and it would be nice if scrolling would be turned off in the beginning and I can enable it at the end of the animation.
1 Correct answer
This is my current fix:
<script>
setTimeout(()=> document.body.classList.remove('your-class') ,4000);
</script>
Copy link to clipboard
Copied
Hi.
Did you try to set the CSS overflow property on the iframe to hidden?
Please let us know.
Regards,
JC
Copy link to clipboard
Copied
That could be a solution. But that means the scroll stays disabled, right? At the end of the animation I need it to scroll again. My current fix is a 'scroll disable timer'. After 4 seconds of being on the webpage, scroll is enabled. It works but isn't really reliable. On the mobile version I just added 'createjs.Touch.enable(stage);' at the first frame and 'createjs.Touch.disable(stage);' at the last.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This is my current fix:
<script>
setTimeout(()=> document.body.classList.remove('your-class') ,4000);
</script>
Copy link to clipboard
Copied
i'm not sure that makes any sense without seeing the html.
Copy link to clipboard
Copied
I gave the body a class ('your-class') and I set the overflow on hidden and after 4 seconds it removes the class and I can scroll again. I guess I just roll with this solution.
Copy link to clipboard
Copied
no problem with that.

