EvanLovely
8/13/2012 - 11:04 PM

reset scaling on iPhones on orientation change

reset scaling on iPhones on orientation change

  // reset scaling on iPhones on orientation change. author: @axolx
  if (navigator.userAgent.match(/iPhone/i)) {
      $(window).bind('orientationchange', function(event) {
          $('meta[name="viewport"]').attr('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0');
          $(window).resize();
      }).trigger('orientationchange');  
  }