Created
October 29, 2018 12:40
-
-
Save asufian97/17c5e393aefef9e78100f5df9678cf6f to your computer and use it in GitHub Desktop.
include inside jquery
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
//// 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