@odopod/odo-scroll-feedback
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Odo Scroll Feedback

Based user input from mouse, keyboard, and touch, the ScrollFeedback instance will emit navigation events with a direction property signifying which way the user should be taken

Install

npm install @odopod/odo-scroll-feedback --save

Quick Start

import OdoScrollFeedback from '@odopod/odo-scroll-feedback';

var scrollFeedback = new OdoScrollFeedback(document.body);

scrollFeedback.on(OdoScrollFeedback.Events.NAVIGATE, function(data) {
  switch (data.direction) {
    case OdoScrollFeedback.Direction.NEXT:
      console.log('go to the next state');
      break;
    case OdoScrollFeedback.Direction.PREVIOUS:
      console.log('go to the previous state');
      break;
    case OdoScrollFeedback.Direction.START:
      console.log('home key pressed');
      break;
    case OdoScrollFeedback.Direction.END:
      console.log('end key pressed');
      break;
  }
}, false);

Documentation

Visit the Odo component directory for demos, code examples, and documentation.

Package Sidebar

Install

npm i @odopod/odo-scroll-feedback

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

105 kB

Total Files

18

Last publish

Collaborators

  • nathanbuchar
  • odopod-admin
  • vestride