title: mCustomSrollbar inside immediate function, why?
body: <p>This is my code: </p>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>(function($) {
      $(window).load(function(){
          $(".bottomWrapperTable").mCustomScrollbar({
              axis: "y",
              theme: "dark",
              scrollbarPosition: "outside",
              callbacks: {
                  whileScrolling: function(){
                      setScroll(this.mcs.left);
                  },
                  onScroll: function() {
                      setStartEndScroll(this.mcs.leftPct);
                  }
              }
          });
      });
  })(jQuery);
  </code></pre>
  
  <p>I followed the mCustomScrollar <a href="http://manos.malihu.gr/jquery-custom-content-scroller/" rel="nofollow">documentation</a> to produce this code.</p>
  
  <p>My question is, why does this function have to be within the immediate funtion even though <code>window.load()</code> is not called until <strong>after</strong> the DOM is ready anyway?</p>
  
  <p>I have tried removing the immediate function but appears to not call the function at all.
  I also tried putting the code within <code>$(function() {}</code> but still no luck.</p>
  
  <p><strong>NOTE:</strong> I am not encountering a problem, just requesting information on this topic.</p>
  
  <p>Any insight into this would be helpful</p>