Created
February 12, 2014 11:43
-
-
Save tarto-dev/8954035 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); | |
} | |
} | |
}); | |
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