filtering - JQuery Isotope Combination Filter - preselection -


i try implement isotope combination filter. 1 of 3 filters should set 1 selection, other 2 filters should show items according these filters. works fine 1 exception: when clicking first time, preselection "lost" , items according preselected filter shown. after preselected filter clicked, works.

as beginner, have no idea how this. ideas how solve this? lot!

<script>   $('#container').isotope({ filter: '.current' });  $(function(){  var $container = $('#container'), filters = {};  $container.isotope({     itemselector : '.prod' });  // filter buttons $('.filter a').click(function(){   var $this = $(this);   // don't proceed if selected   if ( $this.hasclass('selected') ) {     return;   }    var $optionset = $this.parents('.option-set');    // change selected class   $optionset.find('.selected').removeclass('selected');   $this.addclass('selected');    // store filter value in object   // i.e. filters.color = 'red'   var group = $optionset.attr('data-filter-group');   filters[ group ] = $this.attr('data-filter-value');   // convert object array   var isofilters = [];   ( var prop in filters ) {     isofilters.push( filters[ prop ] )   }   var selector = isofilters.join('');   $container.isotope({ filter: selector });    return false; }); 

});


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -