I noticed that he appeared in my Chrome Inspector, which led me to this message ...
What is scroll behavior?
Specifically, this CSSOM-View property 'Scroll-Behavior', the css property was created to integrate the greater CSS flexibility for scrolling DOM elements. Most of the scroll options that are created for websites are usually built on a JS library or plugin. As mentioned above, here is the release - http://dev.w3.org/csswg/cssom-view/#scrolling
The current accepted DOM scroll behavior is set using anchor labels (example: Click Me). When this CSS property is fully implemented in all browsers and correctly implemented (check out this discussion: https://groups.google.com/forum/#!topic/mozilla.dev.platform/mrsNyaLj3Ig ). You can switch the "instant" tag of the anchor tag to a smoother scrolling.
The real question is when will this property be available in border browsers? It is currently recognized by Firefox and Chrome, but the property is not "active" because the study has passed.
#scroll{ width: 350px; height: 500px; scroll-behavior: smooth; overflow: scroll; border: 2px solid black; } #inside1{ height : 1000px; background-color:blue; } #inside2{ height : 1000px; background-color:orange; } #inside3{ height : 1000px; background-color:red; } <nav> <a href="#inside1">#1</a> <a href="#inside2">#2</a> <a href="#inside3">#3</a> </nav> <div id="scroll"> <div id="inside1"></div> <div id="inside2"></div> <div id="inside3"></div> </div>
Check out JSFiddle to see how instant scrolling through anchor tags through the DOM is done - http://jsfiddle.net/timcasonjr/5t0so7n7/3/
Cason
source share