Seeking help on how to fade a pseudo element to opacity:0 on scroll has left me feeling lost and frustrated. I've included my codepen for reference here: http://codepen.io/emilychews/pen/JWyaKr
Unfortunately, Greensock is not an option for this project, and I must use a pseudo element rather than an absolutely positioned div. The desired effect is for the fade to occur after 10px of scrolling from the top, with the element reappearing when the user scrolls back up (part of a navigation element).
HTML
<div id="mydiv">My Div</div>
CSS
#mydiv {
background: red;
width: 10%;
}
#mydiv:after {
content: '';
position: absolute;
height: 10%;
width: 10%;
top: 30px;
background: black;
}
I would greatly appreciate any suggestions or assistance. Right now, I feel like I'm at a breaking point and could either burst into tears or devour a bucket of fried chicken in frustration.
Sincerely, Emily