<...">

Skrollr, Safari, fixed lag positions

I am playing with parallax at the moment and have a problem:

Here is the markup

<div class="welcome"></div>
<div class="welcome2" data-0="top: 100%;" data-1000="top: 0%;"></div>
<div class="weclome_text">
    <h3 data-0="color: rgb(82,98,130);" data-1000="color: rgb(255,255,255);">Hello World</h3>
    <div class="scroll-button" data-0="opacity: 1;" data-300="opacity: 0;"></div>
</div>

And CSS:

html,body { margin: 0; padding: 0; font-family: Sans-serif; }

body {
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.welcome { position: fixed; top: 0; width: 100%; height: 100%; background: url(http://justdade.com/t/bg1.png) no-repeat; background-size: cover; }
.welcome2 { position: fixed; top: 100%; width: 100%; height: 100%; background: url(http://justdade.com/t/bg2.png) no-repeat; background-size: cover; }

.weclome_text {
    position: fixed; position: fixed; top: 50%; left: 50%; margin-left: -60px; margin-top: -60px; width: 120px; height: 120px; color: #526282;
    text-align: center;
}
.scroll-button { background: url(http://justdade.com/t/scroll-button.png); width: 60px; height: 60px; cursor: pointer; margin: 0 auto; }

Jsfiddle

Everything looks fine in all browsers waiting for Safari (Desktop, iOS is good too)

Safari animation lags pretty much after clicking the scroll arrow. I also noticed that scroll delays only start if I use the position: fixed;

Can someone please give me some clue where should I dig?

Thank.

+3
source share
1 answer

Good, so I'm not sure what the problem is. But after many searches, I found a solution. And this:

div { -webkit-transform: translateZ(0);-webkit-backface-visibility: hidden;-webkit-perspective: 1000; }

, . . -, Safari, .

data-0="transform: translate(0%,0%)" data-1200="transform: translate(0%, -100%)"

. top: 0; : 100;

+3

All Articles