Created
August 29, 2012 16:59
-
-
Save justinclayton/3515615 to your computer and use it in GitHub Desktop.
expanded from coffeescript
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
$(document).ready(function() { | |
var search_box; | |
search_box = $('#search'); | |
return search_box.bind('keyup', function() { | |
var items; | |
items = $('.item_link'); | |
return items.each(function() { | |
var item, query; | |
query = $('#search').val(); | |
item = $(this); | |
if (query.length === 0) { | |
return item.show(); | |
} else if (item.text().indexOf(query) === -1) { | |
return item.hide(); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment