Skip to content

Instantly share code, notes, and snippets.

@dmbean
Created October 31, 2011 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dmbean/1329350 to your computer and use it in GitHub Desktop.
Save dmbean/1329350 to your computer and use it in GitHub Desktop.
dereko2
{% block javascripts %}
{{ parent() }}
{% javascripts
'js/jquery.isotope.min.js'
filter='?yui_js'
output='js/packed/isotope.js'
package='versioned'
%}
<script src="{{ asset_url }}"></script>
<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