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

iOS 10+ 没有给内容区域添加 spa-scroll-touch 造成无惯性滚动 #46

Closed
ufologist opened this issue Feb 13, 2017 · 2 comments
Closed

Comments

@ufologist
Copy link

在 iOS 10+ 中测试发现, <div class="container spa-scroll spa-scroll-y"> 没有添加上 spa-scroll-touch 样式, 因此没有应用上惯性滚动的样式 .spa-scroll-touch {-webkit-overflow-scrolling: touch; }

查看代码后发现, 是由于对 iOS 大版本号的获取判断有问题

    if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) {
      $('.spa-scroll', $page).addClass('spa-scroll-touch')
    }

当 iOS 版本为 10+ 时, 例如 10.2.1, $.os.version.slice(0, 1) 只取第一位数字, 因此得到的版本号是 1, 固然判断就不生效了.

因此对 iOS 大版本号的获取应该修改为 parseInt($.os.version.substring(0, $.os.version.indexOf('.')))

@lin-chao
Copy link
Collaborator

@ufologist 建议直接提交修改

zhaoda added a commit that referenced this issue Feb 14, 2017
@zhaoda zhaoda closed this as completed Feb 14, 2017
@zhaoda
Copy link
Owner

zhaoda commented Feb 14, 2017

谢谢 @ufologist 提交bug

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

3 participants