ffuubarbuzz / smoothscroll

Polyfill for window.scrollTo(x, y, 'smooth');

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

smoothscroll.js

Polyfill for

  • window.scroll({ left, top, behavior });

  • window.scrollTo({ left, top, behavior });

  • window.scrollBy({ left, top, behavior });

  • element.scrollIntoView(ScrollOptions); (incomplete)

Use

bower install --save smoothscroll

This depends upon requestAnimationFrame. As such you can use either dist/smoothscroll.js if you have a raf polyfill already included (or are supporting only raf-enabled browsers), or use dist/smoothscroll.raf.js to use a version bundled with a polyfill (batteries included version).

Browser Support

This has been tested successfully in the following browsers:

  • Safari 6+, iOS 6+
  • Firefox
  • Chrome
  • Opera Next

Size

787 bytes minified and gzipped

Standards documentation

About

Polyfill for window.scrollTo(x, y, 'smooth');

License:MIT License


Languages

Language:JavaScript 74.6%Language:HTML 25.4%