ScrollMagic
ScrollMagic copied to clipboard
Disappearing pinned sections on iPad - simple fix
I was designing a page with Scrollmagic and when testing on iPad, noticed that the pinned sections disappeared until the scroll was finished. However, elements within those pinned sections which scaled and animated would appear/disappear. Which made me realize - make sure they are rendered with the GPU and you are golden. So, for the pinned element, just apply something like: will-transform: translate; transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0);
This will cause the GPU to render things and it will work flawlessly on iOS.
You may want to update your examples to include this, since they also suffer from the same problem. Since I found a simple fix, I thought I'd share!
Thanks for sharing! Worked like a charm :)
Thanks ! Worked for me also.
Thank you for this. Worked beautifully for me as well.
Thanks! Was wondering what that happened!
will-transform
isn't a valid CSS property? Do you mean will-change
instead? Which would be used like will-change: 'transform';
.
Tested this solution on iOS10 and doesn't seem to be working.
Same question as @olivertappin here... Fix is not working on my iPhone... Any news on this?
@olivertappin @simonwidjaja Sorry about that, I think I made a typo in the original post with regards to will-change. However, I also since discovered that using will-change isn't necessary. Simply applying the translate3d transform should be sufficient:
transform: translate3d(0,0,0);
Does that not work for you?
@adennis I encountered this issue but, sadly, your transform: translate3d(0,0,0); fix didn't work for me.
Any ideas @olivertappin @adennis @simonwidjaja ?
Eureka! I had to apply that to all of the child elements explicitly.
Hi @olivertappin @adennis @simonwidjaja @adennis and thank you for this thread. I probably face a problem similar to yours.
I am currently working on a one page with a pinned section in which I play a GSAP timeline. Everything works fine except Safari on iOS (including the latest version). The trigger hook scrolls up at the same time as the page and thus never triggers the scene ¯ \ _ (ツ) _ / ¯ ...
➡ To illustrate the problem, I have created this minimalist codepen. The second section has a pinned element, but it is never fixed during the scroll (on iOS only). This demo is free of relative values (vh, percentage or js value). So I think I must miss something...
Do you have a clue? Regards.
Thank you Adennis! It solved my situation!
Hmm.. adding "transform: translate3d(0, 0, 0)" to the pinned elements stops the pinning from working completely..? :/
Also tried adding to all child elements but didn't help either 😭
.pin-element > * { transform: translate3d(0,0,0) }