function fun1(){ var w=document.documentElement.clientWidth; var scale=w/640; document.body.style.zoom=scale; } fun1(); window.onresize=function (){ fun1(); }