Он не показывает класс .hidden, и когда я ищу его, он показывает его, но проблема в том, что он не исчезает, когда я удаляю ввод…
Как это можно исправить, чтобы класс .hidden исчезал, когда я начинаю удалять ввод?
Это мой исходный код:
HTML:
Date
Title
Something
Options
12/06/16
Example
Janko Tomas
Video
GBP
Pound
Active
GEL
Georgian Lari
Active
USD
US Dollar
Active
USD
US Dollar
Active
CSS:
#section{
width: 80%;
margin: auto;
}
.sub-section{
width: 100%;
margin: auto;
position: relative;
}
.table{
width: 100%;
margin: auto;
background-color: white;
}
thead{
background-color: #333;
color: white;
margin: 0;
}
thead tr th{
font-weight: normal;
padding-top: 5px;
padding-bottom: 5px;
}
thead tr{
margin: 0;
padding: 0;
}
.hidden{
display: none;
}
И, наконец, JQUERY:
$(document).ready(function () {
(function ($) {
$('#filter').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr').hide();
$('.searchable tr').filter(function () {
return rex.test($(this).text());
}).show();
$('.hidden').filter(function () {
return rex.test($(this).text());
}).show();
})
}(jQuery));
});
Подробнее здесь: https://stackoverflow.com/questions/378 ... hem-when-i