Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

license

  • Loading branch information...
commit e43c4af9a4164b6cccacc1a83b6c9039b5709c29 1 parent ed0b42b
@dotmaster authored
Showing with 104 additions and 0 deletions.
  1. +27 −0 License.txt
  2. +77 −0 Readme.html
View
27 License.txt
@@ -0,0 +1,27 @@
+Simplified BSD License
+
+Copyright 2010 Gregor Schwab. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ of conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY GREGOR SCHWAB ``AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GREGOR SCHWAB OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those of the
+authors and should not be interpreted as representing official policies, either expressed
+or implied, of Gregor Schwab.
View
77 Readme.html
@@ -0,0 +1,77 @@
+<h1>NEW!!! NOW WORKING EVEN ON IE 7/8</h1>
+
+<h1>Touchable</h1>
+
+<p>Touchable is a very lightweight (1,96kb) jQuery Class that unifies touch and mouse events over different platforms like desktops and mobile devices with touchscreens (like Android, iPad, iPod Touch, iPhone etc.)
+The name Touchable therefore might be a bit confusing, cause we actually generate a generic "Touch" which involves also mouse events. For convenience they are all called "Touches".</p>
+
+<p>Touchable really doesn't depend that much on jQuery, so it should work with other libraries like <a href="http://zeptojs.com/">Zepto</a> too. Havent tested that though.</p>
+
+<h1>Hoverable</h1>
+
+<p>Hoverable is built upon Touchable and is a very lightweight (1,57kB / 3,04 together with Touchable) jQuery Class that unifies hover events over different platforms like desktops and mobile devices with touchscreens (like Android, iPad, iPod Touch, iPhone etc.)
+It introduces a new event called </p>
+
+<ul>
+<li><strong>newHover(2)</strong>: following my <a href="http://grenzgenial.com/post/2429779568/longtap-is-the-new-hover">blog article</a> about UI design and my postulate, that Long Tap is the new Hover. Fired when the user hovers with the mouse or longTaps an element. Hovever if you want to you can set it up to a touchmove event too, which will fire a genericHover2 event.</li>
+</ul>
+
+<h2>Testing</h2>
+
+<p>right now I have tested Touchable on the following devices and browsers Chrome, Firefox, Safari, iPad Simulator, iPad, iPhone, Internet Explorer 7/8. But it should work quite everywhere. If you have any bug notes drop me a line.</p>
+
+<h2>Demo</h2>
+
+<p>I have setup a demo site for Hoverable on the <a href="http://dotmaster.github.com/Touchable-jQuery-Plugin/demo/demo.html">github page</a>. View source to see how everything works.</p>
+
+<h2>Usage</h2>
+
+<p>Right now Touchable supports five basic events and Hoverable adds two generic Hover events, all events when bound with jQuery's bind function get a touch object passed in as second argument</p>
+
+<h1>TOUCHABLE</h1>
+
+<ul>
+<li><strong>touchablemove</strong>: fired when the user touched or clicked with the mouse and moves to another position. Right now Touchable supports up to 2 fingers. If 2 fingers are on screen the lower left is taken as a reference.</li>
+<li><strong>touchableend</strong>: fired when the user ended a touch</li>
+<li><strong>tap</strong>: fired when the user clicks with his mouse or taps with his finger</li>
+<li><strong>longTap</strong>: fired when the user stays with his mouse or finger on an item for 1 second</li>
+<li><strong>doubleTap</strong>: fired when the user taps two times within half of a second</li>
+</ul>
+
+<h1>HOVERABLE</h1>
+
+<ul>
+<li><strong>newHover(2)</strong>: Fired when the user hovers with the mouse or longTaps an element. Hovever if you want to you can set it up to a touchmove event too, which will fire a genericHover2 event.</li>
+</ul>
+
+<p>you use it by initializing Touchable on a view element, like so:</p>
+
+<pre><code>var div = $(&lt;div&gt;).Touchable();
+</code></pre>
+
+<p>or</p>
+
+<pre><code>var div = $(&lt;div&gt;).Hoverable(); //which cretaes a Touchable internally
+</code></pre>
+
+<p>then you bind to the events</p>
+
+<pre><code>div.bind('touchmove', function(e, touch){})
+div.bind('newHover2', function in(e, touch){}, function out(e, touch){})
+</code></pre>
+
+<p>notice, that each event gets passed a touch object, besides the normal event object. The Touch object has the following properties: </p>
+
+<ul>
+<li>startTouch: this is where the touch or mousedown event originated</li>
+<li>currentTouch: this is where we are right now with our finger or mouse </li>
+<li>previousTouch: for internal calculations of the previous position of the mouse pointer or finger, used for deltas see below</li>
+<li>currentDelta: measured from previous move event</li>
+<li>currentStartDelta, currentPosition: the relative position, measured from start calculated in different ways, but should be the same</li>
+</ul>
+
+<h2>Todos</h2>
+
+<ul>
+<li>support more gestures like swiping,...</li>
+</ul>
Please sign in to comment.
Something went wrong with that request. Please try again.