首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

webView中长按后撤除菜单js实现

2012-09-24 
webView中长按后取消菜单js实现!DOCTYPE html?html?head?? script?? ? function absorbEvent_(eve

webView中长按后取消菜单js实现

<!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>?

热点排行