Coder Social home page Coder Social logo

off by 1px? about smoothscroll HOT 6 CLOSED

stevenvachon avatar stevenvachon commented on August 27, 2024
off by 1px?

from smoothscroll.

Comments (6)

jeremenichelli avatar jeremenichelli commented on August 27, 2024

Just tested this in the demopage, last version of Safari and it works perfectly fine.

scrollIntoView in Safari

After applying scrollIntoView the y scrolled position is 0. Check if you have some margin on the #top element or padding in the body.

If you can please specify version of Safari and provide a gist with the example so I can reproduce exactly your issue. Thanks.

from smoothscroll.

stevenvachon avatar stevenvachon commented on August 27, 2024

I have * { padding: 0.025px } to un-collapse all margins. Darn. Wonder what can be done. Would rounding this library's math affect any of its known test cases?

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on August 27, 2024

Well, the thing is that there's an easing function controlling the scrolling steps so rounding numbers might cause an undesired effect. It seems to me that this is project specific issue and not a problem with the polyfill.

from smoothscroll.

stevenvachon avatar stevenvachon commented on August 27, 2024

Ok, thanks.

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on August 27, 2024

No problem. As a final note, If you need to go to the initial position I would try to use scroll or scrollTo with 0 value for top though I don't know well the needs around your project.

from smoothscroll.

stevenvachon avatar stevenvachon commented on August 27, 2024

I'm using a simple pushState router for smooth-scrolling page fragments/hashes. I just did html,body { padding-top:0 } which was fine for my site design.

from smoothscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.