1234567891011121314151617
  1. var metas = document.getElementsByTagName('meta');
  2. var i;
  3. if (navigator.userAgent.match(/iPhone/i)) {
  4. for (i=0; i<metas.length; i++) {
  5. if (metas[i].name == "viewport") {
  6. metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
  7. }
  8. }
  9. document.addEventListener("gesturestart", gestureStart, false);
  10. }
  11. function gestureStart() {
  12. for (i=0; i<metas.length; i++) {
  13. if (metas[i].name == "viewport") {
  14. metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
  15. }
  16. }
  17. }