Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is it possible to disable scroll?

Participant ,
Nov 10, 2022 Nov 10, 2022

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.

857
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Nov 11, 2022 Nov 11, 2022

This is my current fix:

 

<script>
  setTimeout(()=> document.body.classList.remove('your-class') ,4000);
 </script>
Translate
Community Expert ,
Nov 10, 2022 Nov 10, 2022

Hi.

 

Did you try to set the CSS overflow property on the iframe to hidden?

 

Please let us know.

 

Regards,

JC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 11, 2022 Nov 11, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2022 Nov 10, 2022
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 11, 2022 Nov 11, 2022

This is my current fix:

 

<script>
  setTimeout(()=> document.body.classList.remove('your-class') ,4000);
 </script>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2022 Nov 11, 2022

i'm not sure that makes any sense without seeing the html.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 11, 2022 Nov 11, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2022 Nov 11, 2022
LATEST

no problem with that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines