Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $the_portfolio.on('click', '.et_pb_portfolio_filter a', function(e){
- e.preventDefault();
- var category_slug = $(this).data('category-slug');
- var $the_portfolio = $(this).parents('.et_pb_filterable_portfolio');
- var $the_portfolio_items = $the_portfolio.find('.et_pb_portfolio_items');
- if ( 'all' == category_slug ) {
- $the_portfolio.find('.et_pb_portfolio_filter a').removeClass('active');
- $the_portfolio.find('.et_pb_portfolio_filter_all a').addClass('active');
- // remove all items from the portfolio items container
- $the_portfolio_items.empty();
- // fill the portfolio items container with cached items from memory
- $the_portfolio_items.append( all_portfolio_items.find( '.et_pb_portfolio_item' ).clone() );
- $the_portfolio.find('.et_pb_portfolio_item').addClass('active');
- } else {
- $the_portfolio.find('.et_pb_portfolio_filter_all').removeClass('active');
- $the_portfolio.find('.et_pb_portfolio_filter a').removeClass('active');
- $the_portfolio.find('.et_pb_portfolio_filter_all a').removeClass('active');
- $(this).addClass('active');
- // remove all items from the portfolio items container
- $the_portfolio_items.empty();
- // fill the portfolio items container with cached items from memory
- $the_portfolio_items.append( all_portfolio_items.find( '.et_pb_portfolio_item.project_category_' + $(this).data('category-slug') ).clone() );
- $the_portfolio_items.find('.et_pb_portfolio_item').removeClass('active');
- $the_portfolio_items.find('.et_pb_portfolio_item.project_category_' + $(this).data('category-slug') ).addClass('active').removeClass( 'inactive' );
- }
- set_filterable_grid_items( $the_portfolio );
- setTimeout(function(){
- set_filterable_portfolio_hash( $the_portfolio );
- }, 500 );
- $the_portfolio.find('.et_pb_portfolio_item').removeClass( 'first_in_row last_in_row' );
- et_pb_set_responsive_grid( $the_portfolio, '.et_pb_portfolio_item:visible' );
- });
Add Comment
Please, Sign In to add comment