如何删除同位素所有过滤器(也需要重新加载)?

时间:2019-09-19 19:26:25

标签: javascript jquery jquery-isotope

我正在搜索删除,删除,禁用所有过滤器的同位素(也在重新加载时),但是我找不到任何简单的指南!

您可以看到我的过滤器代码:

                 <div class="col-md-12">
                    <div class="filters">
                        <ul>
                        <li class="is-checked" data-filter="*">All</li>
                        <li data-filter=".MeatBurger">Meat Burger</li>
                    <li data-filter=".ChickenBurger">Chicken Burger</li>
                       <li data-filter=".FrenchBurger">French Burger</li>
                         <li data-filter=".FriesBox">Fries Box</li>
                         <li data-filter=".Starters">Starters</li>
                         <li data-filter=".Extras">Extras</li>
            <li data-filter=".DrinksandDesserts">Drinks and Desserts</li>
                  <li data-filter=".CoffeeCorner">Coffee Corner</li>
                       </ul>
                    </div>
                </div>

javascript:

        var $grid = $('.grid').isotope({
        // options
        itemSelector: '.grid-item',
        layoutMode: 'fitRows',
        });

        // change is-checked class on buttons
        var $buttonGroup = $('.filters');
        $buttonGroup.on( 'click', 'li', function( event ) {
        $buttonGroup.find('.is-checked').removeClass('is-checked');
        var $button = $( event.currentTarget );
        $button.addClass('is-checked');
        var filterValue = $button.attr('data-filter');
        $grid.isotope({ filter: filterValue });
        });

0 个答案:

没有答案