mikechambers
mikechambers

Reputation: 3089

Disable Touch Gestures in Android Browser via JavaScript

Does anyone know how to disable touch gestures using JavaScript while running content in the browser on Android?

For example, I want to disable the pinch to zoom gesture via JavaScript.

Upvotes: 1

Views: 2793

Answers (2)

sissonb
sissonb

Reputation: 3780

That can be done with the meta tag, viewport.

<meta name="viewport" content="width=device-width, user-scalable=no" />

I'm not sure if it's possible with JavaScript.

Upvotes: 3

sanchez
sanchez

Reputation: 4530

To add it with JavaScript:

var vp = document.createElement('meta');
vp.name = "viewport";
vp.content = "width=device-width; user-scalable=no;";
document.getElementsByTagName('head')[0].appendChild( vp );

Upvotes: 1

Related Questions