UXerUIer
UXerUIer

Reputation: 2338

Animating css's after and before selectors in jQuery

Is it possible to animate CSS's selectors :before and :after in jQuery's .animate() function? If not, what is the best alternative to doing that?

Upvotes: 2

Views: 2677

Answers (1)

Austin Brunkhorst
Austin Brunkhorst

Reputation: 21130

In short no - jQuery does not support pseudo element animations or even selectors I believe.

You can however animate pseudo elements using css3 transitions but it is to note that only Firefox 4.0+ supports it currently, so your playing field is very limited.

If it's that important, just create new child elements in the element you want to animate them.

Update

Pseudo element animations/transitions are now supported in Chrome as of January 1st, 2013.

You can find a browser support table here.

Upvotes: 5

Related Questions