I have the following question. I created a simple button to go back to the top of the page:
<a href="page-top" class="back-to-top">Back to Top</a>
<script>
$(document).ready(function(){
var btt = $('.back-to-top');
btt.on('click', function(e){
$('html, body').animate({
scrollTop:0
}, 500);
e.preventDefault();
});
$(window).on('scroll', function(){
var self = $(this),
height = self.height(),
top = self.scrollTop();
if(top > height){
if(!btt.is('#page-top:visible')){
btt.fadeIn();
}
} else{
btt.hide();
}
});
});
</script>
However, I would like to apply the same effect to the facebook button for mobile, where the button will only appear when I scroll the scroll up. How?