Skip to content

Instantly share code, notes, and snippets.

@asufian97
Created October 29, 2018 12:40
Show Gist options
  • Save asufian97/17c5e393aefef9e78100f5df9678cf6f to your computer and use it in GitHub Desktop.
Save asufian97/17c5e393aefef9e78100f5df9678cf6f to your computer and use it in GitHub Desktop.
include inside jquery
//// ISOTOPE TRIGGER
var $grid = $('.work-content').isotope({
itemSelector: '.work-item',
stagger: 30
});
$(window).on('load', function(){ $grid.isotope('layout') });
$('.filter-work').on( 'click', '.button', function() {
var filterValue = $(this).attr('data-filter');
$grid.isotope({ filter: filterValue });
});
// change is-checked class on buttons
$('.button-group').each( function( i, buttonGroup ) {
var $buttonGroup = $( buttonGroup );
$buttonGroup.on( 'click', 'a', function() {
$buttonGroup.find('.is-checked').removeClass('is-checked');
$( this ).addClass('is-checked');
});
});
//// MASONRY
$('.work-content').isotope({
itemSelector: '.work-caption img',
masonry: {
columnWidth: 0
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment