Last active
August 29, 2015 14:07
-
-
Save Joseph7451797/88a4bb3bc8ca8bb8903e to your computer and use it in GitHub Desktop.
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
<script type='text/javascript'> // 行動版浮動按鈕的js語法 | |
$(document).ready(function(){ | |
var previous = 0, | |
textWindowNow = 0; | |
$(window).scroll(function(){ | |
previous = $(this).scrollTop(); | |
if(textWindowNow - previous >= 10){ //上滚 | |
$('.footergohome,.footergoaboutme').show("blind", 200 ) | |
} | |
else if (previous - textWindowNow >= 5){ //下滚 | |
$('.footergohome,.footergoaboutme').hide("blind", 300 ) | |
} | |
setTimeout(function(){textWindowNow = previous;},0); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment