As a side note, it's pretty funny to see how much faster every other browser is than Internet Explorer.
Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts
Monday, January 31, 2011
jQuery 1.5 released
This seems like a huge performance winner based on the stats given by the jQuery team. You can download it here: jQuery 1.5
Friday, April 24, 2009
Filter Lists With JQuery
Here's a little snippet that will filter a list as the user types as well as bold the search expression within the list.
The filter expression s updated with <b> tags to highlight the search expression within the text. You can use whatever styling you want, of course.
Enjoy.
$("#searchMyProjects").keyup(function() {
var filter = $(this).val(), count = 0;
$("span.projectSelectionName").each(function() {
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).parent().parent().hide();
$(this).hide();
} else {
$(this).parent().parent().show();
$(this).html($(this).text().replace(new RegExp(filter, "i"), "<b>" + filter + "</b>"));
$(this).show();
count++;
}
});
$("#filterCount").text(count);
});
The filter expression s updated with <b> tags to highlight the search expression within the text. You can use whatever styling you want, of course.
Enjoy.
Subscribe to:
Posts (Atom)