Pseudo elements' CSS with jQuery

Published September 8, 2012

Further to what I wrote yesterday about this, I've written a jQuery plugin to provide a nice interface to pseudo-element CSS changes. Basically it *kind of* allows you to target pseudo-elements for the sake of CSS manipulation. It looks something like this:

$('#element').pseudoCss(':before', 'background-color', 'red');

Check out the code from GitHub. The index.html contains documentation, which you should be able to see online via this link.

Please do read the caveat section before you use it. It should work for most situations but it is inherently limited compared to $.css().

Filed under: web, jquery, javascript, programming, css

Talk is cheap

Leave a comment:

HTML is not valid. Use:
[url=http://www.google.com]Google[/url] [b]bold[/b] [i]italics[/i] [u]underline[/u] [code]code[/code]
'