iPhone粘菜单jquery onscroll ios 9 [英] iphone sticky menu jquery onscroll ios 9

查看:88
本文介绍了iPhone粘菜单jquery onscroll ios 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码在更新到 iOS 9.0.1 (13A404)(
)之前在我的iPhone上运行良好,但是现在看来,只有在手指松开后,该代码才能正常工作,
jQuery onscroll 结束后,当我快速滑动而使页面滚动时...

This code was working fine on my iphone before updating to iOS 9.0.1 (13A404),
but now the same code seems to be working only after finger release,
or after the jQuery onscroll ends, when I do a quick swipe leaving the page scrolling...

$(document).on('scroll', function(){
    if( $(this).scrollTop() > 0){
        $('.menu').addClass('sticky');
    }else{
        $('.menu').removeClass('sticky');
    }
});

粘性菜单消失,直到我从屏幕上松开手指,失去了粘性效果在我以前在所有网站上进行刷卡时,现在已经实时崩溃了。

The sticky menu just disappears until I release the finger up from the screen, losing the "stickying" effect in realtime during the swipe that I had before in all my websites and that are now broken...

如何解决此问题,使它们像以前一样工作? (实时平滑黏贴)

How can solve this problem making them working like I had before? (smooth sticky in realtime)

推荐答案

观察到相同的行为并进行了一些测试之后,最简单的方法是激活3D变换建议

After observing the same behaviour and testing around a bit, the simplest way is to activate 3D transforms as proposed in a similar question:

.sticky-element {
   -webkit-transform: translate3d(0px,0px,0px);
}

这篇关于iPhone粘菜单jquery onscroll ios 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆