twister-html/jQueryPlugins.js

14 lines
334 B
JavaScript
Raw Normal View History

2013-12-30 14:42:36 +00:00
(function(jQuery) {
jQuery.fn.clickoutside = function(callback) {
var outside = 1, self = $(this);
self.cb = callback;
this.click(function() {
outside = 0;
});
$(document).click(function() {
outside && self.cb();
outside = 1;
});
return $(this);
}
})(jQuery);