awips2/components/smoothscroll
2016-04-03 22:04:09 -05:00
..
dist initial publication 2016-04-03 22:04:09 -05:00
bower.json initial publication 2016-04-03 22:04:09 -05:00
Gruntfile.js initial publication 2016-04-03 22:04:09 -05:00
LICENSE initial publication 2016-04-03 22:04:09 -05:00
package.json initial publication 2016-04-03 22:04:09 -05:00
README.md initial publication 2016-04-03 22:04:09 -05:00
smoothscroll.js initial publication 2016-04-03 22:04:09 -05:00
test-element.html initial publication 2016-04-03 22:04:09 -05:00
test.html initial publication 2016-04-03 22:04:09 -05:00

smoothscroll.js

Polyfill for

  • window.scroll(x, y, ScrollOptions);

  • window.scrollTo(x, y, ScrollOptions);

  • window.scrollBy(x, y, ScrollOptions);

  • element.scrollIntoView(toTop, ScrollOptions); (incomplete)

Usage

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+ (desktop, haven't tested iOS)
  • FirefoxNightly
  • Chrome
  • Opera Next

Standards documentation

In The Wild