title: Global variables for nested object classes in jQuery
body: <p>So i have the following structure in my js file:</p>
  
  <pre><code>var scrollingElements = {
  
      doc_height :    null,
      window_height : null,
  
      globalVar : {
          init: function() {
              //Get window and document initial heights
              this.doc_height     = $(document).height();
              this.window_height  = $(window).height();
          }
      },
  
      headerNav : {
          init: function(){
              console.log(this.doc_height);
          }
      },
  
      quickNavSidebar : {
          init: function(){
              console.log(this.doc_height);
          }
      }
  
  }
  
  $(function(){
      scrollingElements.globalVar.init();
      scrollingElements.headerNav.init();
      scrollingElements.quickNavSidebar.init();
  });
  </code></pre>
  
  <p>However, this code doesn't work. <code>this.window_height</code> doesn't reach the right level in the object class. I'm unsure how to get to the higher level in order to store and access the global variables.  I think i need to do something like <code>this.parent()</code>, but obviously that doesn't work :/</p>
  
  <p>Any ideas?</p>