On my website, I want to display a logo in the header only when the site has been scrolled. I attempted to accomplish this with JavaScript:
if(document.getElementById("div").scrollTop != 0){
document.write("<img src='logo.jpg'>");
}
However, my code was unsuccessful. Does anyone know how to achieve this?