尝试过监控键盘和滚轮事件,阻止默认事件,在不同浏览器里表现不一
document.addEventListener('DOMContentLoaded', function (event) { //chrome浏览器 document.body.style.zoom = 'reset'; document.addEventListener('keydown', function (e) { if ((e.ctrlKey === true || e.metaKey === true) && (e.which === 61 || e.which === 107 || e.which === 173 || e.which === 109 || e.which === 187 || e.which === 189)) { e.preventDefault(); } }, false); document.addEventListener('mousewhell DOMMouseScroll', function (e) { if (e.ctrlKey === true || e.metaKey === true) { e.preventDefault(); } }, false); }, false);
推荐学习:JavaScript
以上是js不让电脑端浏览器缩放网页的详细内容。更多信息请关注PHP中文网其他相关文章!