Last active
April 27, 2017 18:53
Star
You must be signed in to star a gist
Isotop Activation Code With Masonry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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