jQuery call not working after Isotope filter is implemented

Posted by user1374796 on Stack Overflow See other posts from Stack Overflow or by user1374796
Published on 2012-10-24T22:05:00Z Indexed on 2012/10/24 23:00 UTC
Read the original article Hit count: 592

I'm currently using the isotope plugin for a fluid layout, I can successfully filter the content, but after the filters have been called, the rest of my jQuery calls fail to work.
Bear with me, I'm still new to jQuery but here's my code:

jQuery(document).ready(function(){

jQuery(".pics-hidden").hide();


jQuery('.pics').click(function() {
      jQuery('#div'+jQuery(this).attr('rarget')).addClass('pics').removeClass('pics-hidden').delay(300).fadeIn(100);
      jQuery('#projectimages').isotope('reloadItems').isotope();
      return false;
       });       

var $container = $('#projectimages');

$container.isotope({
    itemSelector: '.pics',
    animationEngine: 'css',
    masonry: {
    columnWidth: 4
    }
});


$('#menu a').click(function(){
    var selector = $(this).attr('data-filter');
    $container.isotope({ filter: selector });
  return false;
});
});

The filter works fine, as does the ('pics') click function, BUT after the filter has been called, the ('.pics') click function now fails to work.
Is there a reason for this? Or a way to solve it? Tried all sorts, nothing seems to be working.
Any suggestions are greatly appreciated!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-plugins