Skip to content

Instantly share code, notes, and snippets.

@tarto-dev
Created February 12, 2014 11:43
Show Gist options
  • Save tarto-dev/8954035 to your computer and use it in GitHub Desktop.
Save tarto-dev/8954035 to your computer and use it in GitHub Desktop.
jQuery(function($){
$('#Grid').mixitup({
onMixLoad: function(){
var hash = window.location.hash;
var noHash=hash.replace("#","");
if(hash){
$('#Grid').mixitup('filter', noHash);
}
}
});
var filter_btn = $('.mixitup-filter-theme-expand')
var filter = $('.mixitup-filters-tech li');
filter.each(function(i){
if(i > 4){
$(this).hide();
$(this).addClass('mixitup-hidden-filters');
}
});
var hiddens = 1;
filter_btn.live('click', function(){
hiddens = $('.mixitup-hidden-filters').length;
if(hiddens == 0) {
filter.each(function(i){
if(i > 4){
$(this).fadeOut('fast', function(){
$(this).addClass('mixitup-hidden-filters');
filter_btn.html('(+)');
});
}
});
} else {
$('.mixitup-hidden-filters').each(function(){
$(this).fadeIn('slow', function(){
$(this).removeClass('mixitup-hidden-filters');
filter_btn.html('(-)');
});
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment