title: jQuery Isotope add custom class and count filtered items
body: <p>How can i add a custom class to this jQuery Isotope filtering and count the filtered items from isotope:</p>
  
  <pre><code>    $(function(){
  var $container = $('#wrap-planspiel'),
        filters = {};
  
    $container.isotope({
          animationEngine : 'css',
          itemSelector : '.hexblock'
    });
  
    // filter buttons
    $('select').change(function(){
      var $this = $(this);
  
      // store filter value in object
      // i.e. filters.color = 'red'
      var group = $this.attr('data-filter-group');
  
      filters[ group ] = $this.find(':selected').attr('data-filter-value');
      // console.log( $this.find(':selected') )
      // convert object into array
      var isoFilters = [];
      for ( var prop in filters ) {
        isoFilters.push( filters[ prop ] )
      }
      console.log(filters);
      var selector = isoFilters.join('');
      $container.isotope({ filter: selector });
      return false;
    });
  
        $('.filter a').click(function() {
            var $this = $(this);
            if ( $this.hasClass('selected') ) {
          return;
        }
  
        var $optionSet = $this.parents('.option-set');
        // change selected class
        $optionSet.find('.selected').removeClass('selected');
        $this.addClass('selected');
            var group = $this.parent().data('filter-group');
            filters[ group ] = $this.data('filter-value');
            var isoFilters = [];
              for ( var prop in filters ) {
                isoFilters.push( filters[ prop ] )
              }
              console.log(filters);
              var selector = isoFilters.join('');
              $container.isotope({ filter: selector });
              return false;
        });      
  
  });
  </code></pre>
  
  <p>There is an example from desandro but the class remains after reseting all filters: <a href="http://jsfiddle.net/desandro/3nY9V/" rel="nofollow">http://jsfiddle.net/desandro/3nY9V/</a></p>