手機端彈出遮罩層時禁止底層滾動

手機端按用戶體驗來講,有彈出窗的出現的話底層應該禁止滾動,但手機端默認是滾動的;後來找到個簡單的方法:動態修改html,body的overflow,注意:必須同時設置height:100%css html,body{ height:100%, overflow:hidden }html,body{ height:100%, overflow:hidden } 在彈出層消失時再把overflow屬性
相關文章
相關標籤/搜索