This looks pretty useful. I'm curious why you used class to store the "category". Wouldn't it be cleaner to store it in"data-category" or just Javascript? Or is that less browser compliant?
Overall a great script though.
Overall a great script though.
that said, i quickly learned that it's better to use data- attributes and copy them into the class when necessary. otherwise you end up with utilities like getCategoryFromClassName()