Help Portfolio Javascript

I cannot for the life of me figure out why the scrolling function for my ‘.gallery-box’ is firing so early. I am consoling logging the offset().top along with the scrolling variable to see when its firing. For some reason the function is firing around 200px when it should be going much later. Any ideas? Heres the repo to my project (sorry its not on codepen or fiddle :[ )

I think I’m figuring it out. Looks like the window height function applies to the entire DOM height? I was under the impression it was based on the window height of your browsers display area?

Get the current computed height for the first element in the set of matched elements or set the height of every matched element.