Based on your answers i wrote the following plugin:
(function($){
$.fn.rebind = function(){
var init = 'init-rebind';
return this.each(function() {
var is_init = $(this).data(init);
if (!is_init){
$(this).data(init, true);
$(this).bind('click.rebind mouseenter.rebind mouseleave.rebind', function(e){
if ($(this).hasClass('disabled')){
e.stopImmediatePropagation();
e.preventDefault();
}
});
}
});
};
})(jQuery);
Instead of using a global variable i decided to add/remove the class 'disabled' in order to also have control within css.
check out the demo!
THX to all!
UPDATE: Check this out !!