View Single Post
Old 01-13-2013, 01:07 AM   PM User | #3
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,468
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by xelawho View Post
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:

Code:
EVT: mousedown
EVT: mouseup
EVT: click




you may want to stop pulling your hair; i found this text on the jQuery site:
Quote:
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.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%

Last edited by rnd me; 01-13-2013 at 01:09 AM..
rnd me is offline   Reply With Quote