Hello recently I made a game with a scrollable menu where u can scroll using the mouse scroll but when you scroll then the website also move is there a way to only do it inside the game and don't affect the website?
The game I'm talking about: crazygames.com/game/pumpkin-clicker
Add this script to your first layout:
window.addEventListener('keydown', ev => { if (['ArrowDown', 'ArrowUp', ' '].includes(ev.key)) { ev.preventDefault(); } }); window.addEventListener('wheel', ev => ev.preventDefault(), { passive: false });
Develop games in your browser. Powerful, performant & highly capable.
Thanks a lot, it worked, just bought you a coffee, you are really awesome thanks for helping everyone all this years
Thanks! :)