JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<img src = "http://dummyimage.com/120x90/f00/fff.png&text=click_me" />
JavaScript
$.fn.bindUp = function(type, fn) {
type = type.split(/\s+/);
this.each(function() {
var len = type.length;
while( len-- ) {
$(this).bind(type[len], fn);
var evt = $.data(this, 'events')[type[len]];
evt.splice(0, 0, evt.pop());
}
});
};
$('img').click(function() {
alert("bound first, but executing second");
});
$('img').bindUp('click',function() {
alert("bound second, but executing first");
});