一部の要素を除外する必要があるクリック イベントのリスナーがあります。
現在、私のリストは増え続けているため、セレクターに複数の要素を「バンドル」するためのより良い方法を探しています。
これは私が持っているものです:
$(document).on('click tap', function(event) {
if ($(event.target).closest('div:jqmData(panel="popover")').length > 0 ||
$(event.target).closest('div.pop_menuBox').length > 0 ||
$(event.target).closest('.toggle_popover').length > 0 ) ||
$(event.target).closest('.ui-selectmenu').length > 0 {
return;
}
// do stuff
});
これらの要素を除外するより良い方法はありますか?
手伝ってくれてありがとう!