0
嗨即時嘗試做一個過濾器的跨度即時通訊有困難把什麼是跨越小寫或忽略情況。 有什麼建議嗎?在過濾器中的Javascript tolower/ignoreCase
$("#filterinput2").keyup(function() {
var filter = ($(this).val()).toLowerCase(); // get the value of the input, which we filter on
console.log("lower filter" + filter);
if (filter) {
// hide tr's for songs not matching and show tr's for songs matching
$(".tonelist").find(".song:not(:contains(filter))").parent().parent().parent().fadeOut("slow");
$(".tonelist").find(".song:contains(filter)").parent().parent().parent().fadeIn();
if (window.console != undefined) {
console.log($(".tonelist").find(".song:not(:contains(" + filter + "))").parent().parent().parent().innerHTML);
}
$(".tonelist").find(".grouptitle:not(:contains(" + filter + "))").parent().fadeOut("slow");
$(".tonelist").find(".grouptitle:contains(" + filter + ")").parent().fadeIn();
if (window.console != undefined)
console.log($(".tonelist").find(".grouptitle:not(:contains(" + filter + "))").parent().parent().parent().innerHTML);
} else
// if input field is empty, show all tr's
$(".tonelist").find("tr").fadeIn();
ColorLines();
});