This plugin has been developed by me when I start to create this site, with a lot of css manipulations
I decided to write a group of functions and after that I transform it to a plugin. So feel free to use it.
Download it here: jQuery.CssRule (6.66 KB) - 345 hits
Usage example:
| Javascript | | copy code | | ? |
| 1 | |
| 2 | jQuery.cssRule("a", "color", "#ff0000"); |
| 3 | jQuery.cssRule("a:visited", "color", "#ffff00"); |
| 4 | jQuery.cssRule("a:hover", "color", "#ffffff"); |
| 5 |
So that don’t let jQuery search and manipulate all objects colected with a selector, and
manipulate Style Sheet direct.
This code don’t list all elements on the page so you don’t overload nothing on the
visitor computer. All the job will be done by the browser without a lot os javascript process.

Fix bug:
line 56~57
// Is [Prop, Value], but Prop is not “property:value”
} else if ((Property.length == 2) && (typeof Property[0] == “string”) && (Property[0].indexOf(”:”) < 0) &&
(typeof Property[1] == “string”)) {
This logic only process with 2 params passed, have you take a look on the Example 3 of demo page?
Bug Report: background and background-image don’t work with full URLS, probably because of the colon.
$.cssRule(”.myclass”,”background-image”,”url(http://www.g.com/a.gif)”);
Is there a way to do this using cssRule?
Can be something wrong with your page or image reference.
cssRule works fine with background-image and all others css properties.