4 ms·
The web page bobs around when pressing the buttons, when the game area is smaller than the window. Is there any way to make that stop aside from making the area
by kebman 7y ago
The web page bobs around when pressing the buttons, when the game area is smaller than the window. Is there any way to make that stop aside from making the area smaller, so that it fits the window?
- Ravengenocide 7y agoYou could run something like this in the console: window.addEventListener("keydown", function(e) { // space and arrow keys if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) { e.preventDefault(); } }, false); That will prevent the scrolling when pressing the arrow keys. It's of course not a perfect solution, and something more robust would be to check if a game is currently running and so on, but it works as a quick hack.
- Hoppetosse 7y agoThanks for the feedback. I've reworked the page so that it's less likely that the game does not fit in a screen without scrolling - not ideal, but it'll help!