Home  >  Article  >  Web Front-end  >  弹出遮罩层后禁止滚动效果【实现代码】_javascript技巧

弹出遮罩层后禁止滚动效果【实现代码】_javascript技巧

PHP中文网
PHP中文网Original
2016-05-16 15:03:041450browse

弹出遮罩层后禁止滚动效果【实现代码】_javascript技巧

方法一:

$('.shade').bind( "touchmove", function (e) {
   e.preventDefault();
});

方法二:

$("body,.main").height($(window).height()).css({
  "overflow-y": "hidden"
});

以上就是弹出遮罩层后禁止滚动效果【实现代码】_javascript技巧的内容,更多相关内容请关注PHP中文网(m.sbmmt.com)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn