Skip to content

Instantly share code, notes, and snippets.

@Joseph7451797
Last active August 29, 2015 14:07
Show Gist options
  • Save Joseph7451797/88a4bb3bc8ca8bb8903e to your computer and use it in GitHub Desktop.
Save Joseph7451797/88a4bb3bc8ca8bb8903e to your computer and use it in GitHub Desktop.
<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