Skip to content

Instantly share code, notes, and snippets.

@nicco88
Last active December 25, 2016 06:52
Show Gist options
  • Save nicco88/44934a102980f9d1b48b30711f839c81 to your computer and use it in GitHub Desktop.
Save nicco88/44934a102980f9d1b48b30711f839c81 to your computer and use it in GitHub Desktop.
Social box disappearing
window.onscroll = function(){scrollStop()};
function scrollStop(){
var socialBox = document.getElementsByClassName("indexadv")[0];
var breakingPoint = document.body.offsetHeight - document.getElementById("footer").offsetHeight;
var socialBoxHeight = socialBox.clientHeight;
if ((document.body.scrollTop + socialBoxHeight + 50) > breakingPoint){
socialBox.style.display = "none";
} else {
socialBox.style.display = "block";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment