Rev | Line | |
---|
[0] | 1 | /* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ |
---|
| 2 | |
---|
| 3 | // TODO: write unit tests |
---|
| 4 | ToolMan._cssFactory = { |
---|
| 5 | readStyle : function(element, property) { |
---|
| 6 | if (element.style[property]) { |
---|
| 7 | return element.style[property] |
---|
| 8 | } else if (element.currentStyle) { |
---|
| 9 | return element.currentStyle[property] |
---|
| 10 | } else if (document.defaultView && document.defaultView.getComputedStyle) { |
---|
| 11 | var style = document.defaultView.getComputedStyle(element, null) |
---|
| 12 | return style.getPropertyValue(property) |
---|
| 13 | } else { |
---|
| 14 | return null |
---|
| 15 | } |
---|
| 16 | } |
---|
| 17 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.