移动端弹出遮罩层禁止页面滚动,遮罩里面的框不允许滚动


在遮罩层添加 (前提使用vue)@touchmove.prevent

HTML:

    <!--plan A-->
    <div class="overlayer" @touchmove.prevent >
        <div class="popup">
            如果在这个div中滑动,触发的事件会经过overlayer,可以屏蔽滑动
        </div>
    </div>
    <!--plan B-->
    <div class="overlayer" @touchmove.prevent >
    </div>
    <div class="popup"  @touchmove.prevent>
        如果在这个div中滑动,触发的事件也会被禁用默认行为, 也可以屏蔽滑动
    </div>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM