Originally Posted by xelawho
And that's the second question: The way I understand it, the event order is mousedown, click, mouseup. So what happens to the click event? Does it die while the confirm box is showing?
how can a click occur before the mouse button goes up? Note that if you click a button, then drag to ,say the desktop, and release the button, click() is not fired.
i don't think you can actually terminate/prevent a click() from a mousedown...
the reason confirm/alert help is that it prevents the mouseup on the element with the click() event, thus ensuring that the button is not actually clicked.
also , this test app
shows this output:
you may want to stop pulling your hair; i found this text on the jQuery site:
Since the .live() method handles events once they have propagated to the top of the document, it is not possible to stop propagation of live events. Similarly, events handled by .delegate() will propagate to the elements to which they are delegated; event handlers bound on any elements below it in the DOM tree will already have been executed by the time the delegated event handler is called. These handlers, therefore, may prevent the delegated handler from triggering by calling event.stopPropagation() or returning false.