Closed tobsut97 closed 7 years ago
Website: www.ferienwohnung-flatz.at Repo: https://github.com/tobsut97/FerienwohnungFlatz
Decrease the viewport size to around 1280px and then its not working
anymore. I think the problem is either in the index.php
or style.css
file.
I see.
You’re including ScrollReveal 3 at the bottom like this:
<script src="https://unpkg.com/scrollreveal/dist/scrollreveal.min.js"></script>
Can you do me a favor and try the ScrollReveal 4 beta?
<script src="https://unpkg.com/scrollreveal@beta"></script>
Did it, same issue as before.
ScrollReveal 4 exposes a lot more information which can help debugging; can you upload that change to the site so I can take a closer look? (Thanks)
Also, recreating this issue using JSBin would help confirm the bug.
Okay, uploaded the change to the live version of the site. Will try to recreate this issue in JSBin.
Thanks for raising the issue @tobsut97, cause I’m actually having the same problem locally. (I didn’t know removing overflow-x
solved it though.) Except to my knowledge, this only started very recently for me.
I thought it was an update to Chrome, but I'm having some issues across browsers.
What I can see though is that the container element is not correctly registering scroll events when overflow-x
is applied. This can be seen by the scroll.top == 0
below:
When the overflow-x
is removed, the container's scroll properties successfully capture scroll distance:
This is why elements don't reveal: they aren't considered "visible", because visibility depends on scroll position information.
Makes sense. So how do I fix this? Do I have to remove the overflow-x:hidden?
Well, the overflow-x: hidden
elimintates unwanted scrollbars/extra space (particularly on mobile) when using reveal animations that enter from the sides; if you aren‘t worried about that, then in your case, the simple solution is to remove the overflow-x
property.
The part I find confusing is that https://scrollrevealjs.org uses overflow-x: hidden
(and has for years), and even is running v4.0.0-beta.13
... and doesn‘t have this problem, which is why I was hoping we could recreate it with a simple JSbin.
The problem is that my site does some weird things on mobile when I remove the overflow-x property. So I either have to figure out a workaround for this or I have to keep the overflow-x property and we have to figure out a solution.
Well, I’m working on ScrollReveal full-time, and this bug is a priority. I will find a solution.
For you, what if you take overflow-x: hidden
off of the body, and wrap the content in a div that has overflow-x: hidden
instead... does that get you anywhere?
YES! Thanks so much. 👍
This is actually a Webkit bug @tobsut97.... it seems to be the combination of:
<html>
<html>
This causes window.pageYOffset
and document.documentElement.scrollTop
to always return 0.
Hey guys,
when I set
overflow-x: hidden
on<body>
the ScrollReveal animations don't work anymore.I am using Chrome and ScrollReveal v3.3.6.