Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

显示弹窗后页面还可以滚动,滑动体验差 #61

Open
Ale-cc opened this issue Sep 30, 2018 · 1 comment
Open

显示弹窗后页面还可以滚动,滑动体验差 #61

Ale-cc opened this issue Sep 30, 2018 · 1 comment

Comments

@Ale-cc
Copy link

Ale-cc commented Sep 30, 2018

展开弹窗后,在iOS设备上滑动时,html也随之滚动,导致滑动体验很不好。
当我想根据onShow、onHide函数去操作Dom禁止滚动时,这两函数根本不生效!

image

@Ale-cc
Copy link
Author

Ale-cc commented Sep 30, 2018

我的解决办法就是初始化弹窗的时候,
$('html , body').css({ 'overflow-y': 'hidden' })
然后 mobileSelect.callbak 和 取消按钮再绑定上一个事件:
$('.cancel').on('click', function() { $('html , body').css({ 'overflow-y': 'auto' }) })

我是一点不愿这样操作Dom,而文档show、hide函数是一点没作业。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant