Skip to content

Instantly share code, notes, and snippets.

@pixelpony
Forked from dmbean/gist:1329350
Created October 31, 2011 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pixelpony/1329352 to your computer and use it in GitHub Desktop.
Save pixelpony/1329352 to your computer and use it in GitHub Desktop.
dereko
{% block javascripts %}
{{ parent() }}
{% javascripts 'js/jquery.isotope.min.js'
filter='?yui_js'
output='js/packed/isotope.js'
package='versioned' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
<script type="text/javascript">
/* Holiday Gift Guide Filtering Functionality */
$('form#filter input').attr('checked', 'true');
$('form#filter input[name="all"]').click(function(e){
$('form#filter input').attr('checked', this.checked);
});
$('form#filter input').click(function(e){
$('li.curator-grid-item').hide();
$('form#filter input').each(function(){
var rawCategory = $(this).attr('name');
var curatorClass = "." + rawCategory;
var curatorCategory = $('li.curator-grid-item' + curatorClass);
var ifChecked = this.checked;
//console.log($(this).attr("name")+": "+ this.checked + " (curatorClass: "+curatorClass+")");
if (this.checked){
curatorCategory.show();
}
});
});
</script>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment