Is there any way to modify the css of nth-child with after pseudo?
$(".product-block:nth-child(-n+6):after").css("background-color", "#" + col6);
The css of the element results in the black tab as you can see below (to the first six items), I'm making a theme switcher which is why I'm needing to do this.
I think your best bet would be to use .next();
$(".product-block:nth-child(-n+6)").next().css("background-color", "#" + col6);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.