Skip to content

Instantly share code, notes, and snippets.

@kroofy
Created February 11, 2015 14:45
Show Gist options
  • Save kroofy/5480e9ea9d5a5fb32e18 to your computer and use it in GitHub Desktop.
Save kroofy/5480e9ea9d5a5fb32e18 to your computer and use it in GitHub Desktop.
badly performing code using length
// find better $trigger
if( $triggers.length > 1 ) {
$triggers.each(function(){
// vars
$parent = $(this).parent();
if( $target.closest( $parent ).length > 0 ) {
$trigger = $(this);
return false;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment