Disable callout (context menu) on Android
You can try to do this :
window.oncontextmenu = function(event) { event.preventDefault(); event.stopPropagation(); return false;};
I hope this is useful...
<!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('doodle')); } </script> </head> <body onload="init()"> <img id="doodle" src="http://www.google.com/logos/doodles/2015/spain-elections-2015-5652792221892608-hp2x.jpg" width="400"> </body> </html>
This pure CSS approach works for me:
pointer-events: none; // for Android -webkit-touch-callout: none; // for iOS -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;