Last active
December 12, 2015 08:49
-
-
Save hbsnow/4746515 to your computer and use it in GitHub Desktop.
jQuery を使ったスクロールバーの top からの位置による条件分岐
This file contains 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(function(){ | |
var scroll_top = document.body.scrollTop || document.documentElement.scrollTop || document.scrollY || 0; | |
if(scroll_top > 30){ | |
//ブラウザのスクロールバーが30pxより下に行った場合 | |
} | |
if(scroll_top <= 30){ | |
//ブラウザのスクロールバーが30pxより上に行った場合 | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment