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
UX: page should scroll smoothly #1719
Comments
Recently, i needed to implement a smooth scroll in my introJS tutorial, and, as a workaround, you can use introJS onbeforechange function. It looks something like this:
Then, on your element you can data-custom-scroll-to property and set it to something meaningful to you. For instance, I use "top" or "element", for "top", i scroll to top: 0, and for "element", I scroll to top: htmlEl.offsetTop - 300 . My function looks like this:
In this case, my htmlEl look like: Other solution, you can add smooth scrolling globally if you want. But I did not want to do that. |
Description
The element indicator uses an animation (css transistion) to move to the next element. However, if the element is outside of the viewport the page scrolls instantly to the element. It is confusing because the animated element leaves the viewport which then jumps to another location.
Expected Behavior
It would be nice if both would be smoothly animated or none
Actual Behavior
The page scroll is instant.
Potential solution
Use scroll-behavior on html tag (and scrollable container elements) using a separate css class which is applied temporarily. Use the same class to apply the transition to the helper element. Add an option to apply this class, making both animations optional.
The text was updated successfully, but these errors were encountered: