var prevScrollpos = window.pageYOffset; window.onscroll = function() { var currentScrollPos = window.pageYOffset; if (prevScrollpos > currentScrollPos) { var element = document.getElementById("_header_row-335-8"); element.classList.add("mystyle"); } else { var element = document.getElementById("_header_row-335-8"); element.classList.remove("mystyle"); } prevScrollpos = currentScrollPos; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter