mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
9 lines
377 B
TypeScript
9 lines
377 B
TypeScript
export const getStyle = (oElm: any, strCssRule: string): string => {
|
|
if(document.defaultView && document.defaultView.getComputedStyle){
|
|
return document.defaultView.getComputedStyle(oElm, '').getPropertyValue(strCssRule);
|
|
} else if(oElm.currentStyle){
|
|
return oElm.currentStyle[strCssRule.replace(/\-(\w)/g, (strMatch, p1) => p1.toUpperCase())];
|
|
}
|
|
|
|
return '';
|
|
};
|