created this function to detect outside clicks:
function click_outside(ignore, handler) {
$(document).click(function(event) {
if (!$(event.target).closest(ignore).length) {
handler();
}
})
}
I'm not really sure if event handlers is better to be called outside functions or inside function
I dont have this solution but, if you add 'em in any function, You should call this functions on top of the program Right @any ? @GingerPlusPlus @nathaliesperson
jQuery has this builtin
Обсуждают сегодня