Press & hold mouse/touch "long click" special event for jQuery 1.4.x. Inspired by similar events on touch-sensitive devices.
.click( duration, handler )
duration
to the well-known .click
method and you have a long click..bind("longclick", handler)
..longclick( [ duration ], [ handler ] )
duration
is used for target element(s)..click(duration, handler)
when at least handler
is supplied and for .trigger("longclick")
if called without arguments.duration
:duration
is 500 and is stored in jQuery.longclick.duration
variable."longclick"
:Mighty jQuery 1.4.x:
<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'></script>
and jquery.longclick-min.js
(~1 kB):
<script src='jquery.longclick-min.js' type='text/javascript'></script>
Free for use in all personal or commercial projects under both MIT and GPL licenses.
Under intensive loving development. v0.x works just fine, but is very "fluid" API-wise. Till v1.0.
Copyright (c) 2010 Petr Vostřel » Check out my other jQuery plugin Reel for 360° image projection