Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {css: function(property, value){
- if (value === undefined && typeof property == 'string') return this.dom[0].style[camelize(property)];
- css = "";
- var remove = [];
- for (key in property)
- {
- if (!property[key])
- {
- remove.push(key);
- }
- else
- css += key + ':' + property[key] + ';';
- }
- if (typeof property == 'string') css = property + ":" + value;
- if (remove.length){
- var regExpr = new RegExp('(('+remove.join('|') + ')[^;]*)', "g");
- }
- return this.each(function(element) {
- cssText = element.style.cssText + ';';
- if (remove) {
- cssText = cssText.replace(regExpr,''); //remove unchecked css nodes
- }
- cssText += css;
- element.style.cssText = cssText;
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement