+ 1
[Solved] How to disable scrolling temporarily?
Is there a way to toggle between allowing and not allowing scrolling in HTML (using JavaScript)? I've tried using "overflow:hidden" for the body, but it didn't work. (I'd like to make it so that you can't scroll while your aiming because otherwise you can't aim properly.) https://code.sololearn.com/Wz1o64t7s7eg/?ref=app
3 Answers
+ 2
You could controll it with:
position: fixed;
for #ground or whole body.
+ 1
JaScript Thanks! I had tried a similar approach before, but I had done it wrong.
+ 1
Cool C. Scheler , nothing is wrong if it works. In coding are often more than one different solutions.
Happy coding!