Homepage
Sign in / Sign up
  • Share
Go to the profile of Carlos Castro
Never miss a story from Carlos Castro, when you sign up for Medium. Learn more
Never miss a story from Carlos Castro
Go to the profile of Carlos Castro
Carlos Castro
Feb 5, 2016
Why my website is better than yours
Fox Wilson
17036

You can reduce the number of lines in your JS by doing a conditional (ternary) operator in your displayFooter function:

document.getElementById(“footer”).style.display = document.body.scrollTop ? “block”: “none”;

  • Go to the profile of Carlos Castro

    Carlos Castro