Created
February 11, 2015 14:45
-
-
Save kroofy/5480e9ea9d5a5fb32e18 to your computer and use it in GitHub Desktop.
badly performing code using length
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
// 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