Created
February 13, 2014 15:00
-
-
Save tarto-dev/8976523 to your computer and use it in GitHub Desktop.
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
jQuery(function($){ | |
$('#Grid').mixitup({ | |
onMixLoad: function(){ | |
var hash = window.location.hash; | |
var noHash=hash.replace("#",""); | |
if(hash){ | |
$('#Grid').mixitup('filter', noHash); | |
} | |
} | |
}); | |
// EDIT CONFS | |
var filter_btn = $('.mixitup-filter-theme-expand'); | |
var filters_to_show = 5; | |
var filter = $('.mixitup-filters-tech li'); | |
var hidden_class = 'mixitup-hidden-filters'; | |
var btn_plus = '(+)', btn_minus = '(-)'; | |
var effect_speed = 'fast'; | |
// DO NOT TOUCH UNDER THIS HELL CAUTION | |
var hash = window.location.hash; | |
if(!hash){ | |
filter.each(function(i){ | |
if(i > filters_to_show){ | |
$(this).hide(); | |
$(this).addClass(hidden_class); | |
} | |
}); | |
} else { | |
filter_btn.html(btn_minus); | |
} | |
var hiddens = 1; | |
filter_btn.live('click', function(){ | |
hiddens = $('.'+hidden_class).length; | |
if(hiddens == 0) { | |
filter.each(function(i){ | |
if(i > filters_to_show){ | |
$(this).fadeOut(effect_speed, function(){ | |
filter_btn.html(btn_plus); | |
$(this).addClass(hidden_class); | |
}); | |
} | |
}); | |
} else { | |
$('.'+hidden_class).each(function(){ | |
$(this).fadeIn(effect_speed, function(){ | |
filter_btn.html(btn_minus); | |
$(this).removeClass(hidden_class); | |
}); | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment