问题描述:

I'm using the jQuery plugin MixItUp to get some filtering on a list of content I have.

Basic single-dimensional filtering works fine, but I'm trying to use multi-filtering and do not have too much luck with getting it right.

Here is my markup:

<div id="page-nav-main" class="clearfix">

<nav id="menuBrands">

<ul>

<li><span>

<h5>Filter Brands: </h5>

</span></li>

<li class="filter" data-filter="all"><a href="#">Show All</a></li>

<li class="filter" data-filter=".bfs"><a href="#">BusinessForSale.com</a></li>

<li class="filter" data-filter=".fs"><a href="#">FranchiseSales.com</a></li>

<li class="filter" data-filter=".ps"><a href="#">PropertySales.com</a></li>

</ul>

</nav>

<nav id="menuBanners">

<ul>

<li><span>

<h5>Filter Banners: </h5>

</span></li>

<li class="filter" data-filter="all"><a href="#">Show All</a></li>

<li class="filter" data-filter=".leaderboard"><a href="#">Leaderboards</a></li>

<li class="filter" data-filter=".skyscraper"><a href="#">SkyScrapers</a></li>

<li class="filter" data-filter=".mpu"><a href="#">MPUs</a></li>

<li class="filter" data-filter=".doublempu"><a href="#">DoubleMPUs</a></li>

</ul>

</nav>

</div>

Basically, what I'm trying to do: when clicked on BusinessForSale and Leaderboards to show only this type within the BFS category.

Here's my script:

$(function () {

$('#Container').mixItUp({

load: {

filter: 'all'

},

controls: {

toggleFilterButtons: true

}

});

});

I would very much appreciate the kick in the right direction.

Thanks!

网友答案:

try adding toggleLogic: 'and' (it defaults to 'or'...)

 controls: {
            enable: true,
            toggleFilterButtons: true,
            toggleLogic: 'and'
        }
相关阅读:
Top