简体   繁体   English

WebKit中的粘性导航和轮播延迟

[英]Sticky navigation and carousel lag in WebKit on scroll

This is the site I am working on: Click here - Home Page Scroll Issue . 这是我正在工作的网站: 单击此处-主页滚动问题

I am using Foundation 5, a sticky scrollbar and Owl Carousel (I have tried using Slick carousel and the result is the same). 我正在使用Foundation 5,粘性滚动条和Owl Carousel(我尝试使用Slick旋转木马,结果是相同的)。

The issue I'm experiencing is that whenever I scroll up/down and the top bar goes over the carousel, the whole page stutters and the scroll bumps and stops shorter than its expected trajectory. 我遇到的问题是,每当我向上/向下滚动并且顶部栏越过转盘时,整个页面就会出现断断续续,滚动颠簸且停止的时间短于其预期轨迹的情况。

I have tried a lot of solutions including applying z-index and -webkit-transform: translateZ(0) rules to the carousel with no success. 我已经尝试了很多解决方案,包括将z-index和-webkit-transform应用于:转盘上的translationZ(0)规则均未成功。

This problem doesn't seem to exist in Firefox or Edge or at least is not as obvious. 这个问题似乎在Firefox或Edge中不存在,或者至少不那么明显。

Any ideas? 有任何想法吗?

This issue only exists in Chrome. 此问题仅在Chrome中存在。 The issue seems to be that WebKit does not handle layering very well sometimes. 问题似乎是WebKit有时无法很好地处理分层。

Here is the solution that worked perfectly for me: 1) Wrap owl-carousel class with a div : 这是最适合我的解决方案:1)用div包装owl-carousel类:

<div class="carousel-wrapper">
            <div class="large-8 columns" data-equalizer-watch>
                <div id="owl-slider" class="owl-carousel owl-theme">
                    <div><img src="img/carousel/IMG_1332.JPG"></div>
                    <div><img src="img/carousel/IMG_1334.JPG"></div>
                    <div><img src="img/carousel/IMG_1349.JPG"></div>
                    <div><img src="img/carousel/IMG_1350.JPG"></div>
                </div>
            </div>
</div>

2) add the following CSS: 2)添加以下CSS:

.carousel-wrapper { -webkit-transform: translate3d(0, 0, 0);}

I do realise that I've posted this question before and accepted an answer that seemingly worked, but later realised that it broke my navigation bar. 我确实意识到我之前已经发布了这个问题并接受了一个看似有效的答案,但后来意识到它破坏了我的导航栏。 The solution above will both get rid of the flicker issue and keep the topbar fully functioning. 上面的解决方案既可以消除闪烁问题,又可以使topbar正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM