1

Tried CSS:

$('body').on('focus', 'input' , function(){
    console.log('css');
    $(this).data('fontSize', $(this).css('font-size')).css('font-size', '16px');
}); 
$('body').on('blur', 'input' , function(){
    console.log('css');
    $(this).css('font-size', $(this).data('fontSize'));
});

Tried view port way:

$('body').on('blur focus', 'input' , function(){
    console.log('blur focus');
    $('meta[name=viewport]').attr('content', 'width=device-width,initial-scale=0.4,maximum-scale=' + (event.type == 'blur' ? 10 : 1));
}); 

I want pinch zoom to work and I want the auto zoom to happen on click of input form elements.

But Not able to zoom out after zoom in. Thanks in Advance!

Naveen Kumar
  • 197
  • 1
  • 13
  • 1
    Possible duplicate of [How can I reset the zoom after form submission in mobile Safari, while maintaining user scalability afterwards?](http://stackoverflow.com/questions/29927680/how-can-i-reset-the-zoom-after-form-submission-in-mobile-safari-while-maintaini) – Turnip Jan 19 '16 at 13:00
  • In Iphone 5, its not working. IOS9. – Naveen Kumar Jan 19 '16 at 14:02
  • @Festive Turnip Having this in my code. Alert - 'view port change' appears. But not resetting the zoom. `code` var viewportmeta = document.querySelector('meta[name="viewport"]'); if (viewportmeta) { alert('view port change'); viewportmeta.setAttribute('content', 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0'); viewportmeta.setAttribute('content', 'width=device-width, initial-scale=0.4, minimum-scale=0.2'); } `code` – Naveen Kumar Jan 19 '16 at 14:29

0 Answers0