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