Adds an element that allows the user to scroll down.
<grain-scroll-down>
click me to scroll down 100%
</grain-scroll-down>
$ bower install --save daKmoR/grain-scroll-down
Import the package.
<link rel="import" href="/bower_components/grain-scroll-down/grain-scroll-down.html">
Unfortunately Smooth Scroll is still not widely available. But you can easily use a Polyfill like https://github.com/iamdustan/smoothscroll
Example for loading only if needed.
(function() {
'use strict';
// load polyfill for smoothscroll if needed
let scrollBehaviorSupported = ('scrollBehavior' in document.documentElement.style);
if (!scrollBehaviorSupported) {
let script = document.createElement('script');
script.async = true;
script.src = '../bower_components/smoothscroll/dist/smoothscroll.js';
script.onload = onload;
document.head.appendChild(script);
}
})();
For more information, see the API documentation.
First, make sure you have the Polymer CLI installed.
- View the Element via
polymer serve
- Run tests via
polymer test