Posted to tcl by stevel at Fri Jul 31 02:03:54 GMT 2009view raw

  1. if (!window.getComputedStyle) {
  2. window.getComputedStyle = function(el, pseudo) {
  3. this.el = el;
  4. this.getPropertyValue = function(prop) {
  5. var re = /(\-([a-z]){1})/g;
  6. if (prop == 'float') prop = 'styleFloat';
  7. if (re.test(prop)) {
  8. prop = prop.replace(re, function () {
  9. return arguments[2].toUpperCase();
  10. });
  11. }
  12. return el.currentStyle[prop] ? el.currentStyle[prop] : null;
  13. }
  14. return this;
  15. }
  16. }