Created
December 22, 2015 12:05
-
-
Save adamo/39d9c0259e96ace8b7a1 to your computer and use it in GitHub Desktop.
Revisions
-
adamo created this gist
Dec 22, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ masthead = document.getElementById("masthead") height = 100 stop = height window.onscroll = (e) -> scrollTop = (if (window.pageYOffset isnt `undefined`) then window.pageYOffset else (document.documentElement or document.body.parentNode or document.body).scrollTop) # console.log scrollTop # masthead.offsetTop; if scrollTop >= stop masthead.className = "site-header animated" else masthead.className = "site-header" return