我有过滤代码。但过滤的数据是静态数据。现在我希望数据来自数据库。在这里,我展示了代码片段。
这是脚本:
<script>
$('document').ready(function(){
$('#demo').jplist({
itemsBox: '.list'
,itemPath: '.list-item'
,panelPath: '.jplist-panel'
});
});
</script>
这是html设计:
<div
class="jplist-group"
data-control-type="checkbox-group-filter"
data-control-action="filter"
data-control-name="themes">
<input
data-path=".architecture"
id="architecture"
type="checkbox"
/>
<label for="architecture">Architecture</label>
<input
data-path=".christmas"
id="christmas"
type="checkbox"
/>
<label for="christmas">Christmas</label>
</div>
<!-- item 1 -->
<div class="list-item box">
<!-- img -->
<div class="img left">
<img src="img/thumbs/arch-2.jpg" alt="" title=""/>
</div>
<!-- data -->
<div class="block right">
<p class="date">03/18/2012</p>
<p class="title">Architecture</p>
<p class="desc">Architecture is both the process and product of planning, designing and construction. Architectural works, in the material form of buildings, are often perceived as cultural symbols and as works of art. Historical civilizations are often identified with their surviving architectural achievements.</p>
<p class="like">25 Likes</p>
<p class="theme">
<span class="architecture">Architecture</span>,
<span class="brown">Brown</span>
</p>
</div>
</div>
提前致谢。