Skip to content

Instantly share code, notes, and snippets.

@sgentile
Created September 10, 2011 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgentile/1207961 to your computer and use it in GitHub Desktop.
Save sgentile/1207961 to your computer and use it in GitHub Desktop.
find and not find filter
$(".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