MCPcopy Create free account
hub / github.com/controlsjs/controls.js / ng_GetCurrentStyle

Function ng_GetCurrentStyle

src/ng_basic/basic.js:1633–1647  ·  view source on GitHub ↗

* Function: ng_GetCurrentStyle * Gets current (computed) style of element. * * Syntax: * string *ng_GetCurrentStyle* (object elm, string style) * * Parameters: * elm - object element * style - name of the style, for example 'margin-right' * * Returns: * Value o

(o,s)

Source from the content-addressed store, hash-verified

1631 *
1632 */
1633function ng_GetCurrentStyle(o,s)
1634{
1635 var val;
1636 if(document.defaultView && document.defaultView.getComputedStyle)
1637 {
1638 var cstyle=document.defaultView.getComputedStyle(o, '');
1639 if(cstyle) val = cstyle.getPropertyValue(s);
1640 }
1641 else if(o.currentStyle)
1642 {
1643 s = s.replace(/\-(\w)/g, function (s, p){ return p.toUpperCase(); });
1644 val = o.currentStyle[s];
1645 }
1646 return val;
1647}
1648
1649/**
1650 * Function: ng_BeginMeasureElement

Callers 5

ng_findMousePosXFunction · 0.85
ng_findMousePosYFunction · 0.85
ng_ParentPositionFunction · 0.85
ng_GetCurrentStylePxFunction · 0.85
ng_GetScrollBarsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected