Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 636 Bytes

File metadata and controls

23 lines (20 loc) · 636 Bytes

animation-scroll

A light & tiny scroll script with animation effect and no dependancy

we can use the window.scrollTo like this:

  window.scrollTo({
    top: 1000,
    behavior: 'smooth', // smooth、instant、auto
  });

but it's not enough, may be you want to animation like easeInOut etc.

this script use like this:

  animationScroll(document.getElementById('floor6'), 400, function (el) {
    console.log(el);
  });

preview