- <div id="method-Ext.DomHelper-applyStyles"></div>/**\r
- * Applies a style specification to an element.\r
- * @param {String/HTMLElement} el The element to apply styles to\r
- * @param {String/Object/Function} styles A style specification string e.g. 'width:100px', or object in the form {width:'100px'}, or\r
- * a function which returns such a specification.\r
- */\r
- applyStyles : function(el, styles){\r
- if(styles){\r
- var i = 0,\r
- len,\r
- style;\r
-\r
- el = Ext.fly(el);\r
- if(Ext.isFunction(styles)){\r
- styles = styles.call();\r
- }\r
- if(Ext.isString(styles)){\r
- styles = styles.trim().split(/\s*(?::|;)\s*/);\r
- for(len = styles.length; i < len;){\r
- el.setStyle(styles[i++], styles[i++]);\r
- }\r
- }else if (Ext.isObject(styles)){\r
- el.setStyle(styles);\r
- }\r
- }\r
- },\r
-\r