【发布时间】:2018-04-24 15:15:31
【问题描述】:
以前有人对此进行了挖掘,但我似乎无法使其发挥作用。我正在尝试在 Bootstrap 4 上过滤卡片,当我应用搜索查询时,它最终隐藏了我所有的卡片,而不仅仅是它应该隐藏的卡片。
希望任何人都可以提供帮助。
$('#search').keyup(function() {
$('.card').show();
var filter = $(this).val(); // get the value of the input, which we filter on
$('.card-deck').find('.card .card-body h4:not(:contains(" + filter + "))').parent().parent().addClass('d-none');
})
这是完整代码:https://jsfiddle.net/8120104x/#&togetherjs=jTm0prUR4S
【问题讨论】:
-
小提琴不包括 bootstrap 或 jquery
标签: jquery twitter-bootstrap bootstrap-4