How to properly specify context for Drupal behaviours I have this code that does not work. I know why it does not work - first time page is loaded 'context' is all page and jquery easely finds '.view-SPECIFICVIEW .view-content'. After AJAX 'context' has changed and it is now just '.view-SPECIFICVIEW' and inside that there is no class '.view-SPECIFICVIEW' and therefore nothing happens. Script works if I remove '.view-SPECIFICVIEW' from find(), but then all views are selected.

(function ($, Drupal, window, document, undefined) {
    Drupal.behaviors.MYMODULE = {
      attach: function(context, settings) {
        $(context).find('.view-SPECIFICVIEW .view-content').masonry({
          columnWidth : 300,
          gutterWidth : 20
        });
      }
    }
})(jQuery, Drupal, this, this.document);


I would like to have this code to work with '.view-SPECIFICVIEW' and also I would like to know how code changes if multiple, different specific views should be targeted.
Just stop using context in this case.  I've been playing around with jQuery Masonry and I've not needed to use it.

(function ($){
  Drupal.behaviors.myModule ={
    attach: function(context, settings) {
      $('.view-SPECIFICVIEW .view-content').masonry({
        columnWidth : 300,
        gutterWidth : 20      
      })    
    }
  }
})(jQuery);


FYI, I'd also take a look at the Masonry recommendation to use the imagesLoaded plugin if there are images in your view.  It takes a LOT of future frustration out.