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

绑定时机问题 #40

Closed
tanlucheng opened this issue Mar 16, 2017 · 2 comments
Closed

绑定时机问题 #40

tanlucheng opened this issue Mar 16, 2017 · 2 comments

Comments

@tanlucheng
Copy link

感谢老师这么好用的插件,提一个issue,当父节点display为none的时候,此时给其子节点绑定BScroll,把父节点display为block后,滚动不生效。必须在父节点display不为none的时候,绑定BScroll才有效。

@ustbhuangyi
Copy link
Owner

是这样的,因为 better-scroll 在初始化的时候需要有 dom 相关的计算,如果 display 为 none 的话肯定不能正确计算,所以一般 better-scroll 的初始化时机是 dom 渲染后。

@tanlucheng
Copy link
Author

明白

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

2 participants