Android ベースのモバイルで動作する -webkit-touch-callout の代替手段はありますか。モバイル デバイスでロング タッチ ポップアップを無効にしようとしています。jQuerys のタップホールド イベントをバインドして false を返そうとしました。しかし運がない...何か考えはありますか?ありがとう!
5086 次
1 に答える
2
<!DOCTYPE html>
<html>
<head>
<script>
function absorbEvent_(event) {
var e = event || window.event;
e.preventDefault && e.preventDefault();
e.stopPropagation && e.stopPropagation();
e.cancelBubble = true;
e.returnValue = false;
return false;
}
function preventLongPressMenu(node) {
node.ontouchstart = absorbEvent_;
node.ontouchmove = absorbEvent_;
node.ontouchend = absorbEvent_;
node.ontouchcancel = absorbEvent_;
}
function init() {
preventLongPressMenu(document.getElementById('theimage'));
}
</script>
</head>
<body onload="init()">
<img id="theimage" src="http://www.google.com/logos/arthurboyd2010-hp.jpg" width="400">
</body>
</html>
于 2014-06-14T16:40:08.027 に答える