Smooth Scroll Animation, No jQuery!


Change This:

$("html,body").animate({scrollTop:$("#rwid").offset().top},1E3)}

To This:

document.querySelector("#rwid").scrollIntoView({ 
  behavior: "smooth"
});

For Some Free Style, By Length:

window.scroll({
  top:      2500
 ,left:     0 
 ,behavior: "smooth"
});

Or:

window.scroll({
  top:      document.querySelector("#rwid").offsetTop
 ,left:     0 
 ,behavior: "smooth"
});

Optionally adding smooth-scroll CSS rule,
which is more apply to touch related events,
but still nice to have :]

body{
  scroll-behavior:            smooth;
  -webkit-overflow-scrolling: touch;
     -moz-overflow-scrolling: touch;
          overflow-scrolling: touch;
}

And maybe this too,
to reduce the click response
– and provide a more responsive clicks/touch/scroll events.

body{
  height:                   100%;
  overflow-y:             scroll;
  touch-action:     manipulation;
  user-zoom:                none;
  -webkit-user-drag:        none;
     -moz-user-drag:        none;
          user-drag:        none;
}

:]]