title: InfiniteScroll and Custom Behavior
body: <p>I'm using <a href="http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/" rel="nofollow">http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/</a> to provide the infinitescroll functionality, however the default settings of the plugin relies on the href attribute of the next link to detect the current page and ajaxily load the next set of results.</p>
  
  <p>I am already keeping track of the result offset and pagesize in my own javascript objects and just want the infinitescroll plugin to call the window.LoadMore function to load the next results, I checked the plugin code and it looks like i should override the loading.start function(the beginAjax specifically) , </p>
  
  <pre><code>        opts.loading.start = opts.loading.start || function() {
  
              $(opts.navSelector).hide();
              opts.loading.msg
                  .appendTo(opts.loading.selector)
                  .show(opts.loading.speed, function () {
                      beginAjax(opts);
              });
          };
  </code></pre>
  
  <p>is this the right function to override? , and if yes how would i do this from the plugin initialization, the below code won't work</p>
  
  <pre><code>        ($('.deals-list'), this.el).infinitescroll({
              navSelector  : "div.navigation",
              nextSelector : "div.navigation a",
              itemSelector : ".deal",
              debug: true,
              loading.start: function(){
                  alert('testing');
              }
          });
  </code></pre>
  
  <p>Thanks.</p>
  
  <p>Yehia</p>