I added a script that I found here. It works. However, I was stuck trying to apply a fade effect to it. At that moment, it just turns off.
script type="text/javascript">
$(document).ready(function() {
$(window).scroll(function () {
var height = $('body').height();
var scrollTop = $('body').scrollTop();
var opacity = 1;
if(scrollTop > 400) {
opacity = 0;
}
$('.social').css('opacity', opacity);
});
});
</script>
EDIT: I knit this and it works. Many thanks to the guys:
<script type="text/javascript">
$(window).scroll(function() {
var $socialDiv = $('.social');
var windowScroll = $(this).scrollTop();
$socialDiv.css({
'margin-top' : - (windowScroll / 3) + "px",
'opacity' : 1 - (windowScroll / 550)
});
});
</script>
source
share