简体   繁体   中英

How can I Block right click and double tap to zoom?

Gaming is really really fun when you have to tap and hold to do something, and it activates a context menu. Or when you double tap on a game to do an action and it zooms in.

So when I embed a HTML5 game using an iframe, how do I stop right click and double tap to zoom so that the player of the game is not annoyed.

Use FastClick https://github.com/ftlabs/fastclick .. it eliminate the 300ms delay between a physical tap and the firing of a click event on mobile browsers.

window.addEventListener('load', function() {
    FastClick.attach(document.body);
}, false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM