jQuery: Suppress `click` when `dblclick` is imminent?
Let's say I have a <span>
. When you single-click this span, I want a save()
function to fire. When you double-click the span, I want a rename()
function to fire.
If you double-click the span, however, first the click
event will fire, then the dblclick
event. Since the click
precedes dblclick
, how can I tell click
to not 开发者_如何学JAVAfire save()
and instead defer to dblclick
where rename()
will be fired?
I can probably come up with a few workarounds, but is there any existing functionality in jQuery or previous (code) work that helps me with this already?
This looks helpful: single and double-click
精彩评论