Skip to content

Instantly share code, notes, and snippets.

@shehabkhan013
Last active April 27, 2017 18:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shehabkhan013/08cf7681b587d47a44018c629b81eea5 to your computer and use it in GitHub Desktop.
Isotop Activation Code With Masonry
isotop active
--------------
// filter items on button click
$('.portfolio-filter').on( 'click', 'li', function() {
var filterValue = $(this).attr('data-filter');
$grid.isotope({ filter: filterValue });
});
// init Isotope
var $grid = $('.grid').isotope({
itemSelector: '.grid-item',
percentPosition: true,
masonry: {
// use outer width of grid-sizer for columnWidth
columnWidth: '.grid-item',
}
});
//for menu active
$('.portfolio-filter li').on('click', function(event) {
$(this).siblings('.active').removeClass('active');
$(this).addClass('active');
event.preventDefault();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment