6

Is there any viewport meta tag available for iOS 10 ?

I am facing zoom issue on my iPhone. I am using <meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0"> and also user-scalable=no is not working.

Greenonline
  • 1,231
  • 6
  • 19
  • 25

3 Answers3

0

It seems this meta is not taken into account anymore with iOS 10 RC. Users are able to zoom in/out freely even when this meta.

I'm looking for a clean solution for that.

See disable viewport zooming iOS 10 safari?

Community
  • 1
  • 1
lblyweert
  • 33
  • 3
0

fyi, It still works for home screen app

Thịnh Phạm
  • 2,107
  • 4
  • 22
  • 37
  • I had try above meta tag but still not working in any screen if it is working on your home screen app can i have example! –  Sep 22 '16 at 05:40
  • @Rushi `` here you go – Thịnh Phạm Sep 23 '16 at 00:32
  • Thanks @Thinh, I already tried this viewport meta, but it is not working in ios 10. Please let me know if any other solution is there. –  Sep 23 '16 at 05:36
0

I have a fairly heavy GIS web-app that crashes when iOS devices with 1 Gigabyte of RAM try to zoom. After much experimentation, this is what works for me. Hope it helps. If anyone has any suggestions to improve this, then by all means enlighten us all! :)

// CSS (This prevents zoom on input)
input {
    font-size: 16px!important;
}

// JavaScript (I use jQuery). This prevents pinch zoom.
var numTouches = 0;
$('body').on('touchmove', function(event){
    numTouches = event.originalEvent.touches.length;
    if(numTouches > 1){
        event.preventDefault();
    }
});

// And this prevents double tap zoom
var mylatesttap = new Date().getTime();
$('body').on('touchstart', function(event){
    var now = new Date().getTime();
    var timesince = now - mylatesttap;
    if((timesince < 500) && (timesince > 0)){
        // double tap
        event.preventDefault();
        event.stopPropagation();
        event.stopImmediatePropagation();
        //alert('You tapped me Twice !!!');
    }else{
        // too much time to be a doubletap
    }

    mylatesttap = new Date().getTime();
});

This code was built upon samples from this post: Detect double tap on ipad or iphone screen using javascript

Community
  • 1
  • 1
Bryan V.
  • 1
  • 1
  • Just a note, if you un-comment the alert for the double tap zoom blocker, you'll see the alert, but it will disrupt the function somehow and iOS Safari 10.x will still zoom. – Bryan V. Feb 14 '17 at 21:06