freddyhuang

var ruleTxt = $(".wanfan .rule .rule-txt");
var ruleTxtBottom = $(".wanfan .rule .rule-txt .rule-txt-bottom");
var flag = \'\';
$(".wanfan .rule .rule-btn").on(\'click\',function(){
var h=window.screen.height;
ruleTxt.css({\'width\':\'100%\',\'left\':\'0px\'});
ruleTxtBottom.css({\'height\':h/2});
$(".rule .rule-txt").animate({\'bottom\':\'0px\'});
flag = 1;

});
document.addEventListener(\'touchmove\', function (event) {    //监听滚动事件
if(flag==1){                            //判断是遮罩显示时执行,禁止滚屏
event.preventDefault();                   //最关键的一句,禁止浏览器默认行为
}
});

$(".wanfan .rule .rule-txt-top span").click(function(){
$(".rule .rule-txt").animate({\'bottom\':\'-100%\'});
flag = 0;
});

发现连遮罩层都不能滑动了,只能用到选择器;

 

http://www.cnblogs.com/licf/p/4691556.html

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2021-08-10
  • 2021-06-23
  • 2022-12-23
  • 2021-12-19
  • 2022-01-15
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2021-12-19
  • 2021-12-19
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案