Issue
I have this website that displays 'The Game of Life', showing a canvas with the cells. On mobile, you can touch the canvas and it draws some cells, but it also scrolls the screen a little bit, even if the content of the web doesn't occupy more than 80% of the screen. I've tried using
body {
overflow: hidden;
}
But it didn't work Webpage
Solution
EDITED!! I finally solved it. In my CSS i put this:
html, body {
touch-action: none;
}
Maybe it doesn't work for everyone, but solved my problem. Buttons still work properly :)
EDIT: I needed to activate the touch action in the rest of the website, so i replaced the code above, applying it only to the canvas
canvas {
touch-action: none;
}
This allowed to zoom or scroll in the rest of the web, while not in the actual game
Answered By - jbarcos
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.