jQuery.tap.js
/**
* Author: Sergey Bondarenko (BR0kEN)
* E-mail: broken@propeople.com.ua
* Github: https://github.com/BR0kEN-/jTap
* Updated: May 27, 2014
* Version: 0.2.8
*/
(function($, _) {
'use strict';
/**
* @param (object) ev - extending object, which contain event properties.
* - (string) start - start event depending of @isTap.
* - (string) end - start event depending of @isTap.
*/
var ev = {
start: 'touchstart mousedown',
end: 'touchend mouseup'
};
$.event.special[_] = {
setup: function() {
$(this).off('click').on(ev.start + ' ' + ev.end, function(e) {
/**
* Adding jQuery event to @ev object depending of @isTap.
*
* Attention: value of this property will change two time
* per event: first time - on start, second - on end.
*/
ev.E = e.originalEvent.changedTouches ? e.originalEvent.changedTouches[0] : e;
}).on(ev.start, function(e