How to enable pinch zoom on website for mobile devices?

December 13, 2016 18.1k views
Miscellaneous Development CentOS Ubuntu

Pinch zoom is a key feature of mobile browsing, which allow you to to zoom in to read content and out to locate content within a page. I am trying to enable this feature on my website. I've tried to enable zooming by setting meta viewport like this.

<meta name="viewport" content="width=device-width,initial-scale=1">

It's working on my android smartphone(Sony) but it's not zoomable on iPad and iPhone. My site is a php site, design in HTML5. Is this a designing issue or error in above mentioned code.

2 Answers

The viewport meta tag has some other parameters that when added may solve the issue with zooming on iOS. Here's an example:

<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes"/>

user-scalable looks to be the main parameter you're missing that should make the difference.

Thanks for the response, i will replace my code with yours and let you know the effect.

Have another answer? Share your knowledge.