Version 3.18.0
Show:

event-gestures Module

The gestures module provides gesture events such as "flick", which normalize user interactions across touch and mouse or pointer based input devices. This layer can be used by application developers to build input device agnostic components which behave the same in response to either touch or mouse based interaction.

Documentation for events added by this module can be found in the event document for the YUI global.

Example:

YUI().use('event-flick', function (Y) {
    Y.one('#myNode').on('flick', function (e) {
        Y.log('flick event fired. The event payload has goodies.');
    });
});

This module is a rollup of the following modules:

  • event-flick
    Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides velocity of the flick, along with distance and time information.

    Documentation for the flick event can be found on the YUI global, along with the other supported events.

  • event-move
    Adds lower level support for "gesturemovestart", "gesturemove" and "gesturemoveend" events, which can be used to create drag/drop interactions which work across touch and mouse input devices. They correspond to "touchstart", "touchmove" and "touchend" on a touch input device, and "mousedown", "mousemove", "mouseup" on a mouse based input device.

    Documentation for the gesturemove triplet of events can be found on the YUI global, along with the other supported events.