// sorting $('#sort a').click(function(){ // get href attribute, minus the # var $this = $(this), sortName = $this.attr('href').slice(1), asc = $this.parents('.sort').hasClass('asc'); $container.isotope({ sortBy : sortName, sortAscending : asc }); return false; });