This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $(window).scroll(() => { | |
| // Distance from top of document to top of footer. | |
| topOfFooter = $("#footer").position().top; | |
| // Distance user has scrolled from top, adjusted to take in height of sidebar. | |
| scrollDistanceFromTopOfDoc = $(document).scrollTop() + 650; | |
| // Difference between the two. | |
| scrollDistanceFromTopOfFooter = scrollDistanceFromTopOfDoc - topOfFooter; | |
| // If user has scrolled further than footer, | |
| // pull sidebar up using a negative margin. |