临时完成
This commit is contained in:
@@ -5,8 +5,29 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<link rel="stylesheet" href="./normalize.css">
|
||||
<script>
|
||||
window.onload=function () {
|
||||
document.addEventListener('touchstart',function (event) {
|
||||
if(event.touches.length>1){
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
var lastTouchEnd=0;
|
||||
document.addEventListener('touchend',function (event) {
|
||||
var now=(new Date()).getTime();
|
||||
if(now-lastTouchEnd<=300){
|
||||
event.preventDefault();
|
||||
}
|
||||
lastTouchEnd=now;
|
||||
},false);
|
||||
document.addEventListener('gesturestart', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
//designWidth:设计稿的实际宽度值,需要根据实际设置
|
||||
//maxWidth:制作稿的最大宽度值,需要根据实际设置
|
||||
@@ -23,7 +44,9 @@
|
||||
maxWidth = maxWidth || 540;
|
||||
width > maxWidth && (width = maxWidth);
|
||||
var rem = width * 100 / designWidth;
|
||||
remStyle.innerHTML = 'html{font-size:' + rem + 'px;}';
|
||||
// alert(rem)
|
||||
remStyle.innerHTML = 'html{font-size:' + Math.floor(rem) + 'px;}';
|
||||
// alert(window.getComputedStyle(window.document.documentElement)["fontSize"])
|
||||
}
|
||||
|
||||
if (docEl.firstElementChild) {
|
||||
|
||||
Reference in New Issue
Block a user