我想向这个 JS 添加一个搜索字段 - (https://codepen.io/lifeonlars/pen/yaaOey) - 但脚本不起作用。问题出在哪里?这是一个功能代码示例,其中包含一个搜索 (https://codepen.io/bscherer/pen/ONYaQL) 我需要添加到我的代码中...谢谢您的建议
我添加了但没有工作:
$('#search').on('keyup', function() {
var searchValue = this.value.toLowerCase();
$grid.isotope({
filter: function() {
var title = $(this).find('.title').text().toLowerCase();
return title.indexOf(searchValue) > -1;
}
});
});