Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Hide / show element depending on scroll position
(function(target, threshold, elem) {
listener = () => {
if (target.scrollY > threshold) { = 1;
} else { = 0;
})(window, 300, document.querySelector('#rightCol'))

This comment has been minimized.

Copy link
Owner Author

@Lewiscowles1986 Lewiscowles1986 commented Oct 23, 2018

for facebook (where I tested this) the below CSS should be injected (inspect element put inside a <style></style> tag

#rightCol {
    transition: opacity 1s;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.