<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <Metaname= "Apple-mobile-web-app-capable"content= "Yes"> <Metaname= "Apple-mobile-web-app-status-bar-style"content= "BLACK"> <title>Scaling</title> <style>#box{width:100px;Height:100px;background:Red;}Html,body{width:100%;Height:100%;Overflow:Hidden;} </style> <Script>Document.addeventlistener ('domcontentloaded',function() { varC=1;//first define an initial value varOBox=document.getElementById ('Box'); Document.addeventlistener ('Touchstart',function(EV) {//Hand pointing under varOLDC=C;//Put the initial value inside the OLDC . functionGetC (EV) {varX1=ev.targettouches[0].pagex; varY1=ev.targettouches[0].pagey;//two finger scaling is sure to require two fingers, "0" the XY coordinates of the first finger varX2=ev.targettouches[1].pagex;//the coordinates of the second finger vary2=ev.targettouches[1].pagey; vara=X1-x2;//The first finger of the pagex-second finger of the Pagex, so exactly is a triangle between a two right-angled edge; varb=Y1-Y2;//Ibid . returnMath.sqrt (A*a+b*b)//known two square edges open squared to draw bevel edges } if(Ev.targetTouches.length==2){//to determine if it's two fingers , put the initial value of the oblique foot on the point of the two finger to the DOWNC. varDOWNC=GetC (EV); } document.addeventlistener ('Touchmove',function(EV) {//when your fingers move, if(Ev.targetTouches.length==2){//determine if it's two fingers when moving.C=GetC (EV)/DOWNC+OLDC;//At this time the getc (EV) is the move time, with the value of the trailing edge of the oblique foot in addition to the value of not moving, plus his initial value,OBox.style.webkitTransform='Scale ('+C+')';//scale----2D Zoom conversion } },false) },false) },false) </Script></Head><Body> <DivID= "box"></Div></Body></HTML>
Mobile finger Zoom Out plug-in and source code