Похожие чаты

Guys, is it fine adding event handlers inside functions? I

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

2 ответов

15 просмотров

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

Похожие вопросы

Карта сайта