You're right, but as far as I know, Internet Explorer uses element.currentStyle instead of document.defaultView.getComputedStyle . Also, in the prototype's getStyle function there some more javascript code, fixing some of the CSS values. So, it's not just document.defaultView.getComputedStyle, it's also element.currentStyle plus all this fixing magic. This can really call for a wrapper, don't you think?
On 21 Mar, 23:27, Christophe Porteneuve <[EMAIL PROTECTED]> wrote: > Havocado a écrit : > > > have to specify as a function parameter. Is there a way to get all the > > style using Prototype or Scriptaculous? > > Since what you require constitutes, technically, the whole computed > style for the element, and because this feature only exists within DOM > Level 2 CSS (and later), using the AbstractView interface defined in DOM > Level 2 Views, there's no reason to provide a wrapper. Use: > > document.defaultView.getComputedStyle(element, null) > > This will return a CSSStyleDeclaration implementation, which you can use > as a sort of hash object and/or list for all computed CSS properties. > It must be widespread enough, as getStyle relies on it when it finds no > inline style. Read the spec [1] for more details. > > [1]http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-OverrideAndComputed > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
