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

Smooth Scroll into View #164

Open
bredowmax opened this issue Jul 12, 2021 · 0 comments
Open

Smooth Scroll into View #164

bredowmax opened this issue Jul 12, 2021 · 0 comments
Labels
Category: Enhancement New feature or request

Comments

@bredowmax
Copy link
Contributor

bredowmax commented Jul 12, 2021

Describe the enhancement you'd like
Smooth scroll to an anchor on the same page - often a "scroll to top" or "scroll to CTA". It helps user orientate by hinting that s/he is forwarded to a different location of the same page, and not a new page. Supported by most Shopify themes

Describe alternatives you've considered

  1. CSS - Very simple to add, but not supported by all browsers
html {
  scroll-behavior: smooth;
}

--> Works on Chrome, Firefox, Edge on desktop - but not on Safari on mobile/desktop and not on Chrome mobile
https://caniuse.com/?search=scroll-behavior

  1. Vanillla JS: scrollIntoView()
    https://stackoverflow.com/questions/7717527/smooth-scrolling-when-clicking-an-anchor-link?answertab=votes#tab-top
    https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
    https://caniuse.com/?search=scrollintoview

Potential downsides of smooth scrolling: https://css-tricks.com/downsides-of-smooth-scrolling/

@Stephanie-Chou Stephanie-Chou added the Category: Enhancement New feature or request label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants