In my particular implementation of the "real world" example I noticed that the mouse scrolling worked great but the up/down cursor keys and the page up/dn keys didn't do anything. I spent some time on this and now I think I've got a working solution for me. Feel free to roll this into parallax-element somewhere if you want to with the following caveat: the keycodes for page up and down aren't consistent across browsers. So a proper approach would be to find out which browser it is and then to use the correct keycodes on a per-browser basis. Since I don't care about other browsers for my vanity website I'm just coding it for my Mozilla-based browser.
<script>
// translate into the parallax-element's scroller functionality.
function pageScroll(vLines) {
var scroller = document.querySelector('#parallax').scroller;
scroller.scrollTop = scroller.scrollTop + vLines;
}
document.onkeydown = function(e) {
e = e || event;
switch(e.keyCode) {
case 33: // page up
pageScroll(-360);
return false;
case 34: // page down
pageScroll(360);
return false;
case 38: // up cursor
pageScroll(-36);
return false;
case 40: // down cursor
pageScroll(36);
return false;
}
}
</script>
And my initial reference to the parallax-element gets decorated with an id tag like this:
<parallax-element id="parallax">
And that's it. It now listens for up/down cursor and page up/dn and translates this into your scroller. Note that the numbers in the pageScroll() calls are positive or negative depending upon direction and I chose values which make my website scroll nicely. I'd suggest matching the up/down values and then multiplying those by ten for the page up/dn values as I've done.