I have a pretty heavily customized view that needs to rebind a mouseover overlay, as well as rebind a colorbox gallery whenever the infinite scroller loads a new set of .views-row dom objects. I'd like to do this in a way that doesn't modify your core JS code. Any suggestions?

Comments

Macronomicus’s picture

I had this question too because I needed to set off some resizing functions for my paralax page backgrounds & other such things....
What I chose was this tiny plugin... http://benalman.com/projects/jquery-resize-plugin since as luck would have it, Views Infinite Scroll injects content & increases the size of the page.
...then in my code I can do a simple

//detect when a div re-sizes
$("#content-column").resize(function(e){
 //do something
});	
cwithout’s picture

If you have the mouseover and colorbox bound using a Drupal behavior, they should be bound when the pager content loads, because Views Infinite Scroll calls Drupal.attachBehaviors() on the loaded content.

(function ($) {
Drupal.behaviors.[unique_name_for_your_custom_behavior] = {
  attach:function() {
    //Your code that binds events here.
  }
}
})(jQuery);

honza pobořil’s picture

Issue summary: View changes
Status: Active » Closed (outdated)