Skip to content Skip to sidebar Skip to footer

Jquery Javascript: Have A Filtering List(works), Need Help Keeping All LI's Visible When There's No Matches

http://jsfiddle.net/nicktheandroid/ape5U/34/ Type hol into the textbox on the fiddle example. you'll see that all the LI's have the class hidden, making them hidden. now if you mak

Solution 1:

Add a condition at the end of your if (length > 2) statement, so you have:

if (length > 2) {   
   ...
   if(count == 0) $('.filtered li').removeClass("hidden"); //Add this line!
}else{
  ...
}
...

I tested and works ok. Hope this helps. Cheers


Post a Comment for "Jquery Javascript: Have A Filtering List(works), Need Help Keeping All LI's Visible When There's No Matches"