Sha256: be9e299d2a818b5e5b9a2a802d075614f51aa4ea4e75a40577ff19f7bac298ba
Contents?: true
Size: 764 Bytes
Versions: 21
Compression:
Stored size: 764 Bytes
Contents
/** * Bind `el` event `type` to `fn`. * * @param {Element} el * @param {String} type * @param {Function} fn * @param {Boolean} capture * @return {Function} * @api public */ exports.bind = function(el, type, fn, capture){ if (el.addEventListener) { el.addEventListener(type, fn, capture); } else { el.attachEvent('on' + type, fn); } return fn; }; /** * Unbind `el` event `type`'s callback `fn`. * * @param {Element} el * @param {String} type * @param {Function} fn * @param {Boolean} capture * @return {Function} * @api public */ exports.unbind = function(el, type, fn, capture){ if (el.removeEventListener) { el.removeEventListener(type, fn, capture); } else { el.detachEvent('on' + type, fn); } return fn; };
Version data entries
21 entries across 21 versions & 1 rubygems