移动端自适应屏幕方法:
1、百分比
2、viewport利用js设定
(function(){
var w = window.screen.width;
var targetW = ;
var scale = w/targetW; //当前尺寸/目标尺寸
var meta = document.createElement("meta");
meta.name = "viewport";
meta.content = "content-width=640,user-scalable=no,initial-scale="+scale+",minimum-scale="+scale+",maximum-scale="+scale+""
//console.log(scale);
document.head.appendChild(meta);
})();
(function(){
var userAgent = navigator.userAgent;
var regExp = /Android (\d+\.\d+)/;
if( regExp.test(userAgent) ){
var version = parseFloat(RegExp.$1);
if(version>2.3){
var phoneScale = parseInt(window.screen.width)/640;
document.write('<meta name="viewport" content="