Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!takemy.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1953157.aqSPkdTlGX@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Fri, 10 Feb 2012 23:46:54 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: getComputedStyle vs currentStyle with IE 9 Newsgroups: comp.lang.javascript References: <2541188.UZlinSPExI@PointedEars.de> <0ZKdnfcGHO2Bj6jSnZ2dnUVZ_rSdnZ2d@westnet.com.au> <5429156.TnbMflxdSq@PointedEars.de> <5umdnQMO8OI36ajSnZ2dnUVZ_oKdnZ2d@westnet.com.au> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 41 NNTP-Posting-Date: 10 Feb 2012 23:46:54 CET NNTP-Posting-Host: 2d1b8a20.newsspool4.arcor-online.net X-Trace: DXC=O:KFE<>TU0T@@RW1FjIB5S4IUK On 10/02/2012 11:55 PM, Thomas 'PointedEars' Lahn wrote: >> Andrew Poulos wrote: >>> On 10/02/2012 11:38 PM, Thomas 'PointedEars' Lahn wrote: >>>> Andrew Poulos wrote: >>>>> Alas, IE 9 supports window.getComputedStyle but not camel-cased CSS >>>>> property names. So I tried this >>>>> >>>>> function getElStyle(el, IEcssPropName, cssPropName) { >>>>> if (window.getComputedStyle) { >>>>> return document.defaultView.getComputedStyle(el, >>>>> null).getPropertyValue(cssPropName) || >>>>> document.defaultView.getComputedStyle(el, >>>>> null).getPropertyValue(IEcssPropName); >>>>> >>>>> } else if (el.currentStyle) { >>>>> return el.currentStyle[IEcssPropName]; >>>>> } >>>>> >>>>> return null; >>>>> } >>>>> >>>>> and it seems to work. Is there a better way? >>>> Yes. >>> Good, could you tell what it is? >> Yes. >> >> (This would actually be funny for me if it was not so disappointing.) > > Its disappointing to me as well. All you need to do is asking a *smart* question. PointedEars -- var bugRiddenCrashPronePieceOfJunk = ( navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1 ) // Plone, register_function.js:16