Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(window).on('load', function () {
- $('.portfolio-container').each(function(i, e){
- var ttGrid = $(this).find('.portfolio');
- var self = this;
- ttGrid.shuffle({
- itemSelector: '.portfolio-item' // the selector for the items in the grid
- });
- /* reshuffle when user clicks button filter item */
- $(this).find('.portfolio-filter li').on('click',function (e) {
- e.preventDefault();
- // set active class
- $(self).find('.portfolio-filter li').removeClass('active');
- $(this).addClass('active');
- // get group name from clicked item
- var ttGroupName = $(this).attr('data-group');
- // reshuffle grid
- ttGrid.shuffle('shuffle', ttGroupName);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement