Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 13, 2020 11:13 pm GMT

Pseudo-elements in the Web Animations API

To use the Web Animations API (e.g. el.animate()) you need a reference to a DOM element to target. So, how do you use it on pseudo-elements, which don’t really offer a direct reference? Dan Wilson covers a (newish?) part of the API itself:

const logo = document.getElementById('logo');logo.animate({ opacity: [0, 1] }, {  duration: 100,  pseudoElement: '::after'});

I noticed in Dan’s article that ::marker is supported. I was just playing with that recently while doing our List Style Read article “Pseudo-elements in the Web Animations API”

The post Pseudo-elements in the Web Animations API appeared first on CSS-Tricks.


Original Link: https://danielcwilson.com/blog/2020/05/pseudo-waapi/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks