1

我有 4 个元素和 3 组控件需要过滤

控件

<div class="controls">
<ul>
    <h4>Width</h4>
    <li class="filter" data-filter="Fixed Fluid">Either</li>
    <li class="filter" data-filter="Fixed">Fixed Width</li>
    <li class="filter" data-filter="Fluid">Fluid Width</li>
</ul>
<ul>
    <h4>Columns</h4>
    <li class="filter" data-filter="1 2 3">Show All</li>
    <li class="filter" data-filter="1">1 Column</li>
    <li class="filter" data-filter="2">2 Column</li>
    <li class="filter" data-filter="3">3 Column</li>
</ul>

<ul>
    <h4>Carousel</h4>
    <li class="filter" data-filter="Yes No">Both</li>
    <li class="filter" data-filter="No">No Carousel</li>
    <li class="filter" data-filter="Yes">Carousel</li>
</ul>
</div>

过滤器

<ul id="Grid">
<li class="mix Fixed Yes 1"><h6>Item 1</h6></li>
<li class="mix Fixed No 2"><h6>Item 2</h6></li>
<li class="mix Fluid No 2"><h6>Item 3</h6></li>
<li class="mix Fluid No 1"><h6>Item 4</h6></li>
</ul>

功能

$(function(){
    $('#Grid').mixitup( {
        multiFilter: false,
        filterLogic: 'or',
        transitionSpeed: '600'
    });
}); 

不明白如何能够从每个列表中选择一个项目并让它显示匹配的过滤器。使用“和”filterLogic 会导致更多问题,因为可以选择同一列表中的多个控件。我迷路了,找不到任何演示。提示和建议?

jsFiddle

4

0 回答 0