My blur event fires but not my click event. If I remove the blur event code the click event works fine.
How do I change the order these events fire?
$.fn.autoComplete = function () {
$(document).on('click', '#' + settings.resultsDivId + ' tr', function () {
console.log('click fired');
$('#' + settings.resultsDivId).hide();
});
this.on('blur', function () {
console.log('blur fired');
$('#' + settings.resultsDivId).hide();
});
function AutoComplete(term) {
// ajax call stuff
}
};
Changing click
to mousedown
solved it. Apparently click
fires after blur
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.