Why I'm not able to do this:
$(".item").on('click', 'a.close', closeItem());
function closeItem() {
$(".item").fadeOut({
duration: 400,
}
});
}
and yet this works
$(".item").on('click', 'a.close', function() {
$(".item").fadeOut({
duration: 400,
}
});
});
why cant you replace generic handler with a declared one?