Answer the question
In order to leave comments, you need to log in
How to combine Isotope plugin and bootstrap?
Hello, how to make friends between the Isotope plugin and bootstrap.
Namely,
there are buttons: All, Auto, Cooking.
<section class="catalog">
<div class="container">
<div class="row">
<div class="button-group filter-button-group">
<button data-filter="*">Все</button>
<button data-filter=".item-g">Авто</button>
<button data-filter=".item-t">Кулинария</button>
</div>
<div class="grid-catalog">
<div class="col-lg-3 item-catalog item-g">
Авто - 1
</div>
<div class="col-lg-3 item-catalog item-t">
Кулинария - 1
</div>
<div class="col-lg-3 item-catalog item-g">
Авто - 2
</div>
<div class="col-lg-3 item-catalog item-t">
Кулинария - 2
</div>
</div>
</div>
</div>
</section>
$( document ).ready(function() {
// init Isotope
var $grid = $('.grid-catalog').isotope({
// options
});
// filter items on button click
$('.filter-button-group').on( 'click', 'button', function() {
var filterValue = $(this).attr('data-filter');
$grid.isotope({ filter: filterValue });
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question