Dynamically update CSS attributes of pseudo elements.
This plugin was created from a need to update pseudo elements in fluid ways that could not be addressed by individual classes.
Such use cases may be:
- responding to user input (mouse, touch etc.),
- animating based on variables and
- using attr() values in other attributes other than content.
Since JavaScript can't manipulate these elements directly, as they are not considered "real" elements, there is little to no support for such functionality. This may change in the future...
Install plugin after jQuery and you should be good to go.
Use the pseudo
method on the parent element, whenever appropriate in your logic.
Example:
$el.pseudo("after","margin-top", "10px");
The options of the plugin are currently fixed, and they are the following (in order):
- pseudo selector: before, after
- attribute name
- attribute value
Initiated by Makis Tracend ( @tracend )
Distributed by Makesites.org
Inspired by a micro-lib of Andrew McGivery
Released under the MIT license