Browse Source

docs : filtering : initialize isotope before filter

helps with #98
pull/101/head
David DeSandro 13 years ago
parent
commit
a23c18e552
  1. 10
      _posts/docs/2010-12-06-filtering.mdown

10
_posts/docs/2010-12-06-filtering.mdown

@ -71,9 +71,17 @@ Here we set the filter for each link with a `data-filter` attribute. In our jQue
{% highlight javascript %} {% highlight javascript %}
// cache container
var $container = $('#container');
// initialize isotope
$container.isotope({
// options...
});
// filter items when filter link is clicked
$('#filters a').click(function(){ $('#filters a').click(function(){
var selector = $(this).attr('data-filter'); var selector = $(this).attr('data-filter');
$('#container').isotope({ filter: selector }); $container.isotope({ filter: selector });
return false; return false;
}); });

Loading…
Cancel
Save