How can we improve the Microsoft Edge developer experience?

CSSOM View Smooth Scroll API

Adds an optional argument to existing scroll APIs that specifies whether scrolling should be smooth. Also adds a CSS property for this.

Spec: http://dev.w3.org/csswg/cssom-view

167 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Jonathan Sampson [MSFT]Jonathan Sampson [MSFT] shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • JonathanJonathan commented  ·   ·  Flag as inappropriate

        Just used in a project with jQuery fallback... Would be great to see it in more browsers! Maybe this snippet is helpful:

        var nav_top = jQuery("#site-navigation").offset().top; // Element that you want to scroll to...

        // Try to use native smooth scrolling
        // Thanks: https://blog.hospodarets.com/native_smooth_scrolling
        if('scrollBehavior' in document.documentElement.style){
        window.scrollTo(
        {"top": nav_top, "behavior": "smooth"}
        )
        } else {
        jQuery('html, body').animate({
        scrollTop: nav_top
        }, 1000);
        }

      • Taylor HuntTaylor Hunt commented  ·   ·  Flag as inappropriate

        This is especially nice from a user standpoint, because it obviates scroll-jacking that never works quite right.

        From what I understand, current scroll methods recalculate style and relayout, so this would be a more performant way to achieve smooth scroll-tos.

      Feedback and Knowledge Base