pisi / Longclick

Press & hold mouse/touch "long click" special event for jQuery 1.4
GNU General Public License v2.0
48 stars 27 forks source link

Is there a way to detect when the longclick has ended? #5

Open alfrednerstu opened 12 years ago

alfrednerstu commented 12 years ago

I'm adding a style after the longclick and would like to remove it when the longclick is over (either the user end the click or start moving the mouse/finger). My code looks like this right now:

$('.draggable').click(500, function() {
  $(this)
    .addClass("ui-draggable-hover");
});

Thanks in advance!

pisi commented 12 years ago

Longclick itself ends when the delay has been topped and is announced by the "longlick" event.

If you mean to catch the moment when the mouse/finger has been released after triggering a longclick, you may have success in binding to "mouseup" event.