Created
August 7, 2015 20:46
-
-
Save hattmarris/9efb7761cfdd85c827c7 to your computer and use it in GitHub Desktop.
JQuery with Native JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assuming we have a jQuery ui autcomplete loaded... | |
// jQuery listener | |
$(domain).on('autocompleteclose', callback); | |
// Native listeners functionally equivalent to 'autocompleteclose' listener | |
domain.addEventListener('blur', callback); | |
domain.addEventListener('focusout', callback); | |
var ul = document.querySelector('.ui-autocomplete'); | |
ul.addEventListener('click', callback); | |
// Arbitrary callback | |
function callback(e) { | |
console.log(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment