<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Event - Hammer.JS</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <script src="http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
            <h1><a href="../index.html">Hammer.JS: Event</a></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: 1.1.0dev</em>
        </div>
    </div>
    <div class="yui3-g">

        <div id="sidebar" class="yui3-u">
            <div id="modules" class="sidebox">
    <div class="hd">
        <h2 class="no-toc">Modules</h2>
    </div>
    <div class="bd">
        <ul>
            
                <li><a href="../modules/gestures.html">gestures</a>
                
                </li>
            
                <li><a href="../modules/hammer.html">hammer</a>
                
                </li>
            
        </ul>
    </div>
</div>

<div id="classes" class="sidebox">
    <div class="hd">
        <h2 class="no-toc">Classes</h2>
    </div>
    <div class="bd">
        <ul>
            
                <li><a href="../classes/Detection.html">Detection</a></li>
            
                <li><a href="../classes/Drag.html">Drag</a></li>
            
                <li><a href="../classes/Event.html">Event</a></li>
            
                <li><a href="../classes/Gesture.html">Gesture</a></li>
            
                <li><a href="../classes/Hammer.html">Hammer</a></li>
            
                <li><a href="../classes/Hold.html">Hold</a></li>
            
                <li><a href="../classes/Instance.html">Instance</a></li>
            
                <li><a href="../classes/PointerEvent.html">PointerEvent</a></li>
            
                <li><a href="../classes/Release.html">Release</a></li>
            
                <li><a href="../classes/Swipe.html">Swipe</a></li>
            
                <li><a href="../classes/Tap.html">Tap</a></li>
            
                <li><a href="../classes/Touch.html">Touch</a></li>
            
                <li><a href="../classes/Transform.html">Transform</a></li>
            
                <li><a href="../classes/Utils.html">Utils</a></li>
            
        </ul>
    </div>
</div>


<div id="methods-on-page" class="sidebox on-page">
    <div class="hd">
        <h2 class="no-toc">Methods On Page</h2>
    </div>
    <div class="bd">
        <ul>
            
                <li><a href="#methods_collectEventData">collectEventData</a></li>
            
                <li><a href="#methods_determineEventTypes">determineEventTypes</a></li>
            
                <li><a href="#methods_doDetect">doDetect</a></li>
            
                <li><a href="#methods_getTouchList">getTouchList</a></li>
            
                <li><a href="#methods_off">off</a></li>
            
                <li><a href="#methods_on">on</a></li>
            
                <li><a href="#methods_onTouch">onTouch</a></li>
            
        </ul>
    </div>
</div>









<div id="fileTree" class="sidebox">
    <div class="hd">
        <h2 class="no-toc">Files</h2>
    </div>
    <div class="bd">
        <ul><li>src\detection.js/<ul></ul></li><li>src\event.js/<ul></ul></li><li>src\export.js/<ul></ul></li><li>src\gestures\drag.js/<ul></ul></li><li>src\gestures\gesture.js/<ul></ul></li><li>src\gestures\hold.js/<ul></ul></li><li>src\gestures\release.js/<ul></ul></li><li>src\gestures\swipe.js/<ul></ul></li><li>src\gestures\tap.js/<ul></ul></li><li>src\gestures\touch.js/<ul></ul></li><li>src\gestures\transform.js/<ul></ul></li><li>src\instance.js/<ul></ul></li><li>src\pointerevent.js/<ul></ul></li><li>src\setup.js/<ul></ul></li><li>src\utils.js/<ul></ul></li></ul>
    </div>
</div>



        </div>

        <div id="main" class="yui3-u">
            <div class="content"><h4>Class Event</h4>



<span class="foundat">Class defined in: <a href="../files/src_event.js.html#l4"><code>src\event.js:4</code></a></span>
<div class="intro"></div>



<div id="classdocs">
    <ul>
        
        <li><a href="#methods">Methods</a></li>
        
        
        <li><a href="#props">Properties</a></li>
        
        
        
    </ul>
    <div>
        
            <div id="methods">
            
                <a name="methods_collectEventData"></a>
<div class="method item">
    <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> <strong class="name"><code>collectEventData</code></strong>( <code>element, eventType, touches, ev </code> ) 
    <br>
    <span class="foundat">
    
        
    
        <a href="../files/src_event.js.html#l286"><code>src\event.js:286</code></a>
    </span><br>
    <p>collect basic event data</p>

    
    <strong>Parameters:</strong>
    <ul class="params">
    
        <li>
        
            <code>element</code> <strong>&lt;<a href="https://developer.mozilla.org/en/Document_Object_Model_(DOM)/HTMLElement" class="crosslink external" target="_blank">HTMLElement</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>eventType</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>&gt;</strong>
        
        
        <p>matches <code>EVENT_START|MOVE|END</code></p>

            
        </li>
    
        <li>
        
            <code>touches</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>ev</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>&gt;</strong>
        
        
         
            
        </li>
    
    </ul>
    
    
    
    <br><div class="returns"><strong>Returns:</strong> &lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>&gt; <p>ev</p>
</div>
    
    
    
</div>

            
                <a name="methods_determineEventTypes"></a>
<div class="method item">
    <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> <strong class="name"><code>determineEventTypes</code></strong>( <code>  </code> ) 
    <br>
    <span class="foundat">
    
        
    
        <a href="../files/src_event.js.html#l206"><code>src\event.js:206</code></a>
    </span><br>
    <p>we have different events for each device/browser
determine what we need and set them in the EVENT_TYPES constant
the <code>onTouch</code> method is bind to these properties.</p>

    
    
    
    <br><div class="returns"><strong>Returns:</strong> &lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>&gt; <p>events</p>
</div>
    
    
    
</div>

            
                <a name="methods_doDetect"></a>
<div class="method item">
    <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a> <strong class="name"><code>doDetect</code></strong>( <code>ev, eventType, element, handler </code> ) 
    <br>
    <span class="foundat">
    
        
    
        <a href="../files/src_event.js.html#l134"><code>src\event.js:134</code></a>
    </span><br>
    <p>the core detection method
this finds out what hammer-touch-events to trigger</p>

    
    <strong>Parameters:</strong>
    <ul class="params">
    
        <li>
        
            <code>ev</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>eventType</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>&gt;</strong>
        
        
        <p>matches <code>EVENT_START|MOVE|END</code></p>

            
        </li>
    
        <li>
        
            <code>element</code> <strong>&lt;<a href="https://developer.mozilla.org/en/Document_Object_Model_(DOM)/HTMLElement" class="crosslink external" target="_blank">HTMLElement</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>handler</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a>&gt;</strong>
        
        
         
            
        </li>
    
    </ul>
    
    
    
    <br><div class="returns"><strong>Returns:</strong> &lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>&gt; <p>triggerType matches <code>EVENT_START|MOVE|END</code></p>
</div>
    
    
    
</div>

            
                <a name="methods_getTouchList"></a>
<div class="method item">
    <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a> <strong class="name"><code>getTouchList</code></strong>( <code>ev, eventType </code> ) 
    <br>
    <span class="foundat">
    
        
    
        <a href="../files/src_event.js.html#l247"><code>src\event.js:247</code></a>
    </span><br>
    <p>create touchlist depending on the event</p>

    
    <strong>Parameters:</strong>
    <ul class="params">
    
        <li>
        
            <code>ev</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>eventType</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>&gt;</strong>
        
        
         
            
        </li>
    
    </ul>
    
    
    
    <br><div class="returns"><strong>Returns:</strong> &lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a>&gt; <p>touches</p>
</div>
    
    
    
</div>

            
                <a name="methods_off"></a>
<div class="method item">
     <strong class="name"><code>off</code></strong>( <code>element, type, handler, [hook] </code> ) 
    <br>
    <span class="foundat">
    
        
    
        <a href="../files/src_event.js.html#l55"><code>src\event.js:55</code></a>
    </span><br>
    <p>simple event unbinder with a hook and support for multiple types</p>

    
    <strong>Parameters:</strong>
    <ul class="params">
    
        <li>
        
            <code>element</code> <strong>&lt;<a href="https://developer.mozilla.org/en/Document_Object_Model_(DOM)/HTMLElement" class="crosslink external" target="_blank">HTMLElement</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>type</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>handler</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>[hook]</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a>&gt;</strong>
        
        
         
            
            <ul>
            
                <li><code>type</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>&gt;</strong> 
                
                </li>
            
            </ul>
            
        </li>
    
    </ul>
    
    
    
</div>

            
                <a name="methods_on"></a>
<div class="method item">
     <strong class="name"><code>on</code></strong>( <code>element, type, handler, [hook] </code> ) 
    <br>
    <span class="foundat">
    
        
    
        <a href="../files/src_event.js.html#l37"><code>src\event.js:37</code></a>
    </span><br>
    <p>simple event binder with a hook and support for multiple types</p>

    
    <strong>Parameters:</strong>
    <ul class="params">
    
        <li>
        
            <code>element</code> <strong>&lt;<a href="https://developer.mozilla.org/en/Document_Object_Model_(DOM)/HTMLElement" class="crosslink external" target="_blank">HTMLElement</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>type</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>handler</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>[hook]</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a>&gt;</strong>
        
        
         
            
            <ul>
            
                <li><code>type</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>&gt;</strong> 
                
                </li>
            
            </ul>
            
        </li>
    
    </ul>
    
    
    
</div>

            
                <a name="methods_onTouch"></a>
<div class="method item">
    <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a> <strong class="name"><code>onTouch</code></strong>( <code>element, eventType, handler </code> ) 
    <br>
    <span class="foundat">
    
        
    
        <a href="../files/src_event.js.html#l73"><code>src\event.js:73</code></a>
    </span><br>
    <p>the core touch event handler.
this finds out if we should to detect gestures</p>

    
    <strong>Parameters:</strong>
    <ul class="params">
    
        <li>
        
            <code>element</code> <strong>&lt;<a href="https://developer.mozilla.org/en/Document_Object_Model_(DOM)/HTMLElement" class="crosslink external" target="_blank">HTMLElement</a>&gt;</strong>
        
        
         
            
        </li>
    
        <li>
        
            <code>eventType</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>&gt;</strong>
        
        
        <p>matches <code>EVENT_START|MOVE|END</code></p>

            
        </li>
    
        <li>
        
            <code>handler</code> <strong>&lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a>&gt;</strong>
        
        
         
            
        </li>
    
    </ul>
    
    
    
    <br><div class="returns"><strong>Returns:</strong> &lt;<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a>&gt; <p>onTouchHandler  the core event handler</p>
</div>
    
    
    
</div>

            
            </div>
        
        
            <div id="props">
            
                <a name="props_prevent_mouseevents"></a>
<div class="props item">
    <code>prevent_mouseevents</code> &lt;<strong><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></strong>&gt;
    
    
    <br>
    <span class="foundat"><a href="../files/src_event.js.html#l9"><code>src\event.js:9</code></a></span>
    <p>when touch events have been fired, this is true
this is used to stop mouse events</p>

    
    
</div>

            
                <a name="props_should_detect"></a>
<div class="props item">
    <code>should_detect</code> &lt;<strong><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></strong>&gt;
    
    
    <br>
    <span class="foundat"><a href="../files/src_event.js.html#l28"><code>src\event.js:28</code></a></span>
    <p>when the mouse is hold down, this is true</p>

    
    
</div>

            
                <a name="props_started"></a>
<div class="props item">
    <code>started</code> &lt;<strong><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></strong>&gt;
    
    
    <br>
    <span class="foundat"><a href="../files/src_event.js.html#l19"><code>src\event.js:19</code></a></span>
    <p>if EVENT_START has been fired</p>

    
    
</div>

            
            </div>
        
        
        
    </div>
</div>
</div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/js/tabs.js"></script>
</body>
</html>
