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

Safari Parallax (demo and real-live code) looks super juggy #167

Closed
nexflo opened this issue Sep 21, 2014 · 12 comments
Closed

Safari Parallax (demo and real-live code) looks super juggy #167

nexflo opened this issue Sep 21, 2014 · 12 comments
Labels

Comments

@nexflo
Copy link

nexflo commented Sep 21, 2014

http://janpaepke.github.io/ScrollMagic/examples/advanced/parallax_sections.html

Your demo in safari...looks extremly jumpy/jiggy/whizzy or just unsmooth (butter smooth in chrome)

@coolheinze
Copy link

This seems to be a general issue on Safari (at least on Mac - iOS looks okay-ish). The http://janpaepke.github.io/ScrollMagic/ demo looks awful as well, which is a shame, 'cause it used to look so awesome! :o( Might be a recent Safari update.

@cnewfeldt
Copy link

I'm seeing the same thing on Safari and Firefox. Chrome is fine.

@josephniet
Copy link

OS: OSX 10.9.5
Firefox v32.0.2 - fine
Chrome v37.0.2062.122 - fine
Safari v 7.1 (9537.85.10.17.1) - juddery (like it momentarily gets reset/goes backwards sometimes?)

@coolheinze
Copy link

Safari Version 7.1 (9537.85.10.17.1): Noticed problem pinning. Seems like the pinning spacer has some lag that could cause the judder. Making an element inside the pinned stuff fade in simultaneously made it smooth...? Could be Safari trying to optimise something, which gets a little too optimised.

BTW: Is this a GreenSock issue rather than ScrollMagic?

Update:
Nopes, still judders despite the fading thing. My apologies.
Also, if the spacer is causing the problem, this issue is probably not related to GreenSock.

@janpaepke
Copy link
Owner

I know what is causing this issue and was already made aware of it by @Ihatetomatoes.
I'm quite sure I know what's causing this: to save on performance ScrollMagic doesn't always update on scroll but on tick.
But even though the tick is tested on scroll and should occur before redraw, sometimes there can be delays between the scroll and the actual update of ScrollMagic.
That is why the position is wrong.
I noticed this and asked about this penomenon on stack overflow a while ago:
http://stackoverflow.com/questions/25685608/why-is-an-interval-function-executed-before-an-event-callback

I don't want to get into this too much, but I already have an idea how to address this.

I'll keep you posted.
Thanks for the reports! :)

regards,
J

@janpaepke janpaepke added the bug label Sep 29, 2014
@janpaepke
Copy link
Owner

Oh, and it's definitely not a GSAP issue.

@janpaepke
Copy link
Owner

All right,I fixed it.
Chrome and Firefox are buttersmooth now.
Safari can sometimes still be a bit jittery, but this depends on how much is redrawn at once.
At the moment I have no idea how to make it as perfect in Safari as it is in Firefox an Chrome.

Anyway: While I was at it, I also changed the parallax sections example.
Instead of moving the background I now move the position of a child element.
This has the benefit that I can use percentages and so in responsive environments you wouldn't have to modify the tween if the container's size changes.

I will push the update in the next couple of days.

janpaepke added a commit that referenced this issue Oct 14, 2014
The tickers and setTimeouts were removed and replaced by
requestAnimationFrame.
This should solve the „juggy" behavior described here:
#167
@janpaepke
Copy link
Owner

go get it while it's hot. :)

@ThePath
Copy link

ThePath commented Mar 27, 2015

So its all nice and smooth used in that way. But on your demo you just have the backgrounds with no content in the sections. When you are adding elements that you dont want to move with the background into the section container, you have to either absolute position everything or you have to make the div containing your background image absolute and the other content relative so it overlays it. This method produces the jerky/juggy/jitteriness.

Or am I missing something is there an easier way to have the moving background image with content overlayed and have the background image run smooth?

@janpaepke
Copy link
Owner

If you have content in front of the parallax element, you should have it positioned absolutely and put it behind the other content either by DOM order or z-index.
Still to my knowledge moving the element using transformY should be the best aproach.

Please note, that there currently are some jitters reported for the parallax effect, and they are being reviewed: #256

If you're having trouble with the correct markup for this, please post this as a new issue, linking to a fiddle with the setup as far as you've gotten it.

@ThePath
Copy link

ThePath commented Mar 27, 2015

In your parallax sections demo the background image is positioned relatively. I have recreated your example and it works without jitters but when absolutely positioning the div with background image so to add content in front of it the jitters are quite bad. I will see if I can set up a fiddle.

@GuenniWeb
Copy link

by the way a little offtopic but is there a short way to create a scroll effect like on http://www.apple.com/de/macos/sierra/
very nice idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants