Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
larukedi edited this page Dec 15, 2014 · 1 revision

Subscribing to a touch event

Usage: $l.dom.setEvent(element, eventName, fnc)

var movingObject = $l.id('moving-object');

$l.dom.setEvent(
    movingObject,
    'tap',
    function(event) {
        console.log('tap', event);
    }
);

$l.dom.setEvent(
    movingObject,
    'dbltap',
    function(event) {
        console.log('dbltap', event);
    }
);

$l.dom.setEvent(
    movingObject,
    'longtap',
    function(event) {
        console.log('longtap', event);
    }
);
Clone this wiki locally