禁止页面缩放(禁止页面使用滚轮)
<!--<script>--> <!--//禁止页面滚轮--> <!--function disabledMouseWheel() {--> <!--if (document.addEventListener) {--> <!--document.addEventListener('DOMMouseScroll', scrollFunc, false);--> <!--}//W3C--> <!--window.onmousewheel = document.onmousewheel = scrollFunc;//IE/Opera/Chrome--> <!--}--> <!--function scrollFunc(evt) {--> <!--return false;--> <!--}--> <!--window.onload=disabledMouseWheel;--> <!--</script>--> <script> $(document).ready(function () { // chrome 浏览器直接
<script> $(document).ready(function () { // chrome 浏览器直接加上下面这个样式就行了,但是ff不识别 $('body').css('zoom', 'reset'); $(document).keydown(function (event) { //event.metaKey mac的command键 if ((event.ctrlKey === true || event.metaKey === true)&& (event.which === 61 || event.which === 107 || event.which === 173 || event.which === 109 || event.which === 187 || event.which === 189)){ event.preventDefault(); } }); $(window).bind('mousewheel DOMMouseScroll', function (event) { if (event.ctrlKey === true || event.metaKey) { event.preventDefault(); } });}); </script>