You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
907 B
JavaScript
28 lines
907 B
JavaScript
10 months ago
|
(function(document) {
|
||
|
var metas = document.getElementsByTagName('meta'),
|
||
|
changeViewportContent = function(content) {
|
||
|
for (var i = 0; i < metas.length; i++) {
|
||
|
if (metas[i].name == "viewport") {
|
||
|
metas[i].content = content;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
initialize = function() {
|
||
|
changeViewportContent("width=device-width, minimum-scale=1.0, maximum-scale=1.0");
|
||
|
},
|
||
|
gestureStart = function() {
|
||
|
changeViewportContent("width=device-width, minimum-scale=0.25, maximum-scale=1.6");
|
||
|
},
|
||
|
gestureEnd = function() {
|
||
|
initialize();
|
||
|
};
|
||
|
|
||
|
|
||
|
if (navigator.userAgent.match(/iPhone/i)) {
|
||
|
initialize();
|
||
|
|
||
|
document.addEventListener("touchstart", gestureStart, false);
|
||
|
document.addEventListener("touchend", gestureEnd, false);
|
||
|
}
|
||
|
})(document);
|