a、用zepto的tap事件,但不兼容pc
b、用fastclick
c、tappy
d、touchjs
<script> functionBlockMove(event){ //Tell Safari not to move the window. event.preventDefault(); } </script> <body ontouchmove="BlockMove(event);"> ... </body>
//Detect whether device supports orientationchange event, otherwise fall back to //the resize event. varsupportsOrientationChange="onorientationchange"inwindow, orientationEvent=supportsOrientationChange?"orientationchange":"resize"; window.addEventListener(orientationEvent,function(){ alert('HOLY ROTATING SCREENS BATMAN:'+window.orientation+" "+screen.width); },false);
// Mobile Safari in standalone mode if(("standalone"inwindow.navigator)&&window.navigator.standalone){ // If you want to prevent remote links in standalone web apps opening Mobile Safari, change 'remotes' to true varnoddy, remotes=false; document.addEventListener('click',function(event){ noddy=event.target; //Bubble up until we hit link or top HTML element. Warning: BODY element is not compulsory so better to stop on HTML while(noddy.nodeName!=="A"&&noddy.nodeName!=="HTML"){ noddy=noddy.parentNode; } if('href'innoddy&&noddy.href.indexOf('http')!==-1&&(noddy.href.indexOf(document.location.host)!==-1||remotes)){ event.preventDefault(); document.location.href=noddy.href; } },false); }
-webkit-text-size-adjust:none;
-webkit-user-select:none;
-webkit-touch-calloutt:none;
<input type="text"x-webkit-speech />
<input type="file"accept="image/*; capture=camera" /> <input type="file"accept="video/*; capture=camcorder" /> <input type="file"accept="audio/*; capture=microphone" />
兼容安卓微信调用摄像头 <input type="file" name="file" capture="camera"> 兼容安卓默认选择sd卡上的相册图片 <input type="file" name="file" accept="image/*" >
<a href="sms:18888886666,18888885555"> 发送短信给多个人