function resize() {
    // sectionPositions will be each sections
    // starting position relative to the top
    // of the first section.
    sectionPositions = [];
    var startPos;
    sections.each(function(d,i) {
      var top = this.getBoundingClientRect().top;
      if(i === 0) {
        startPos = top;
      }
      sectionPositions.push(top - startPos);
    });
    console.log(sectionPositions);
    containerStart = container.node().getBoundingClientRect().top + window.pageYOffset;
  }
/**
   * resize - called initially and
   * also when page is resized.
   * Resets the sectionPositions
   *
   */
called initially and
also when page is resized.
Resets the sectionPositions
called initially and also when page is resized . Resets the sectionPositions
function resize() {
    sectionPositions = [];
    var startPos;
    sections.each(function(d,i) {
      var top = this.getBoundingClientRect().top;
      if(i === 0) {
        startPos = top;
      }
      sectionPositions.push(top - startPos);
    });
    console.log(sectionPositions);
    containerStart = container.node().getBoundingClientRect().top + window.pageYOffset;
  }
function resize ( ) { sectionPositions = [ ] ; var startPos ; sections . each ( function ( d , i ) { var top = this . getBoundingClientRect ( ) . top ; if ( i === 0 ) { startPos = top ; } sectionPositions . push ( top - startPos ) ; } ) ; console . log ( sectionPositions ) ; containerStart = container . node ( ) . getBoundingClientRect ( ) . top + window . pageYOffset ; }
resize - called initially and
 also when page is resized.
resize - called initially and also when page is resized .
// sectionPositions will be each sections // starting position relative to the top // of the first section.