root / trunk / patches / getNumericStyle.diff
| Revision 1806, 0.6 kB (checked in by alex, 3 years ago) |
|---|
-
style.js
99 99 var s = dojo.style.getComputedStyle(element, cssSelector); 100 100 if (s == ''){ return 0; } 101 101 if (dojo.lang.isUndefined(s)){ return NaN }; 102 var match = s.match(/([\d.]+)([a-z]*)/); 103 if (!match || !match[1]) 104 return NaN; 105 var n = Number(match[1]); 106 return (n == 0 || match[2]=='px' ? n : NaN); 102 var match = s.match(/([\d\.]+)(px){0,1}/i); 103 return match ? Number(match[1]) : NaN; 107 104 } 108 105 109 106 dojo.style.getMarginWidth = function(node){
Note: See TracBrowser
for help on using the browser.