禁止safari默认样式 放大字体 a button等自带阴影问题
* {
-webkit-tap-highlight-color: transparent; /*取消按钮效果功能*/
-webkit-user-select:auto;
webkit-touch-callout:none; /*取消按钮文字放大效果功能*/
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
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;
})
$('body').on('touchend',function(e) { //阻止双击放大
e.preventDefault();
});