getSimpleElementStyle
[ Function ]
public static getSimpleElementStyle(
element: Jquery<Element> | readonly Element[] | NodeListOf<Element> | HTMLCollectionOf<Element> | Element | undefined
): Dictionary<string>;
Returns all set CSS properties of an HTML element. If the transferred object contains several elements (like for an jQuery collection), the first element is used.
Parameter
Name | Type | Description |
---|---|---|
element Info Type Element supported from version 1.10 | JQuery<Element>, readonly Element[], NodeListOf<Element>, HTMLCollectionOf<Element>, Element, undefined |
|
Return value
Type | Description |
---|---|
| Object with all CSS properties of the first element in the jQuery collection. Returns an empty object in the event of an error. |
Available from 1.8 |
Sample - JavaScript
var control = TcHmi.Controls.get('TcHmiButton')
if(control === undefined){
return;
}
var cntrlElem = control.getElement();
var allStyles = TcHmi.StyleProvider.getSimpleElementStyle(cntrlElem);
/* returns:
{
'z-index': '0',
'border-width': '0px',
'height': '50px',
'left': '164px',
'top': '334px',
'width': '100px'
}*/
TcHmi.Log.debug('Border Width is: '+ allStyles['border-width']);