views:

247

answers:

1

function first(a){ if (a == 'a'){ return false; } }

function second(){
  return 'a';
}

$('.c').click(first).click(second);

How to send message to other chained events? Or stop others from one?

+2  A: 

To stop next clicks from happening, you can use the stopImmediatePropagation method:

$("p").click(function(event){
  event.stopImmediatePropagation();
});
$("p").click(function(event){
  // This function won't be executed
});

To send messages among callbacks, I don't know any other way than using external variables.

Actually, this is almost a dupe of http://stackoverflow.com/questions/652495/jquery-multiple-event-handlers-how-to-cancel...

Seb