Purpose: You have a number of bound events of a specific type to an
element that are applied depending on specific user interactions.
However, when one of them is bound, it needs to be fired first and
then prevent the others from being fired until it has been unbound and
then return normal behavior for the rest of the bound events. This
particular bound event could be added to the stack whenever, which
would could possibly allow other bound events to fire before it.

Example:

$('#myTestEl').click(function() { console.log('first event'); });
$('#myTestEl').click(function() { console.log('second event'); });
$('#myTestEl').click(function(e) {
    console.log('I would like to be first and prevent everyone else
from running!');
    e. stopImmediatePropagation();
});
$('#myTestEl').click(function() { console.log('forth event'); });

$('#myTestEl').click();

NORMAL OUTPUT:
first event
second event
I would like to be first and prevent everyone else from running!

DESIRED OUTPUT (if could make the third bound function the first to
fire):
I would like to be first and prevent everyone else from running!


Then when you unbound the third function the output would be:
first event
second event
third event


I saw an older plugin that added some functionality to the bind method
to do this... but the last time it was verified was against 1.2.x and
hasn't been updated since. So, maybe this functionality is now part of
1.3.x and I am simply missing it in the docs?

Reply via email to