I'm using CSS generated content to add a fade to the bottom of my page:
body::after {
background: linear-gradient(transparent, #000);
bottom: 0;
content: "";
height: 25%;
left: 0;
pointer-events: none;
position: absolute;
right: 0;
z-index: 8;
}
I want to dynamically change the value for bottom via jQuery; however, I can't seem to target the pseudo-element. For instance, something like this doesn't work:
$("body::after").css("bottom", value);
Is there any way to do this?
bottomis dynamic. If I added a class, I'd still have to set a defined value forbottomin the CSS and wouldn't be able to change it via jQuery, so that makes no difference. Sounds like this isn't possible.