Created
March 10, 2015 14:11
-
-
Save tkrkt/4eabd0e62aa50bc1325f to your computer and use it in GitHub Desktop.
This file contains 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
// @example getParentHanders($('#hogehoge')) | |
function getParentHandlers(element, result){ | |
if(!element) return result; | |
element = $(element)[0]; | |
result = result || []; | |
var handlers = $._data(element, 'events'); | |
if(handlers) result.push({element: element, handlers: handlers}); | |
return getParentHandlers(element.parentElement, result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment