移动web端禁止长按a标签,弹出“在浏览器中打开”菜单
长按press事件会导致浏览器弹出菜单:
方法一:
苹果禁止:
-webkit-touch-callout: none;
安卓的不行。禁止弹出只能用js来控制:
$('a').ontouchstart = function(e) { e.preventDefault(); };
方法二:
长按press事件会导致浏览器弹出菜单:
方法一:
苹果禁止:
-webkit-touch-callout: none;
安卓的不行。禁止弹出只能用js来控制:
$('a').ontouchstart = function(e) { e.preventDefault(); };
方法二: