1.2.0 • Published 6 years ago

@odopod/odo-scroll-feedback v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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.

1.2.0

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago