A
A
AliasKarg2014-07-23 12:45:38
JavaScript
AliasKarg, 2014-07-23 12:45:38

How to cancel the ability to zoom in Google Chrome via multitouch?

I solved the problem for non-scrollable pages by adding a handler:

document.body.addEventListener('touchmove', function (e) {
    if (e.touches.length > 1) {
        e.preventDefault();
    }
});

However, while scrolling the page, if you accidentally touch with your finger, the page scales and pops out a warning: Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
PS The problem needs to be solved for personal use, not for production.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Kirenkov, 2014-07-23
@DeLaVega

Of course, I can be a bit off topic, but
will it save?

B
begemot_nn, 2014-07-23
@begemot_nn

There is a suspicion that content scaling cannot be disabled on a desktop browser, because it is implemented "under the hood" of the browser, and does not depend on the content itself.
"CTRL" + "+" will work in desktop chrome so you don't write in your html
and for mobile browser @DeLaVega above wrote the correct instruction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question