Skip to content

Instantly share code, notes, and snippets.

@dcrec1
Created February 3, 2011 20:38
Show Gist options
  • Select an option

  • Save dcrec1/810147 to your computer and use it in GitHub Desktop.

Select an option

Save dcrec1/810147 to your computer and use it in GitHub Desktop.
function eventForSelectorHandler(selector, eventType) {
var lives = jQuery.data(document, "events").live;
for (var i = 0; i < lives.length; i++) {
var live = lives[i];
if ($(selector).is(live.selector)) {
var event = $.Event(eventType);
live.handler.call($(selector)[0], event);
return event;
}
}
}
eventForSelectorHandler("nav a:first", "click").isPreventDefault()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment