640) { var scalefactor = window.innerWidth / 640 var newWidth = 640 / scalefactor $(“meta[name=’viewport’]”).attr(“content”, “width=”+newWidth+”, initial-scale=”+scalefactor+”, maximum-scale=”+scalefactor+”, minimum-scale=”+scalefactor+”, user-scalable=no”); } else if( navigator.userAgent.match(/iPad/i)) { $(“meta[name=’viewport’]”).attr(“content”, “width=640”); } } ]]>

Source