Created
September 10, 2011 05:14
-
-
Save sgentile/1207961 to your computer and use it in GitHub Desktop.
find and not find filter
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
$(".navigatorModifierSearch").live('keyup', function (event) { | |
var $navigationelementsContainer = $(this).parent().parent().find(".navigationelementsContainer"); | |
var searchTerm = $(this).val(); | |
if (searchTerm.length > 0) { | |
$navigationelementsContainer.find('div[data-name*="' + searchTerm.toUpperCase() + '"]').removeClass("hideNavElement"); | |
$navigationelementsContainer.children().not('div[data-name*="' + searchTerm.toUpperCase() + '"]').addClass("hideNavElement"); | |
} else { | |
//make sure all are showing | |
$navigationelementsContainer.children().removeClass("hideNavElement"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment