I'd like to be able to search and display these based on the class attributes, such as "kitchen". I can't find anything on searching by the class, only text and such. Or if anyone has a recommendation on a better way to search and display images. Any help would be greatly appreciated.
<form id="live-search" method="post">
<fieldset>
<input type="text" class="text-input" id="filter" />
<span id="filter-count"></span>
</fieldset>
</form>
<br/>
<br/>
<div id="gallery">
<div id="item" class="#1 Category-Home Home">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x150" />
</a>
</div>
<div id="item" class="#2 Category-Kitchen Kitchen">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x150" />
</a>
</div>
<div id="item">
<div class="#3 Category-Outdoors Outdoors">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x150" />
</a>
</div>
</div>
<div id="item" class="#4 Category-Sports Sports">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x150" />
</a>
</div>
</div>
$(document).ready(function() {
$("#filter").keyup(function() {
});
});
https://jsfiddle.net/sgrg4b06/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…