On Feb 16, 11:01 pm, keif <[email protected]> wrote: > Sounds like you might have to loop through the stylesheet itself. > > I'm curious though, why you need the % value? Perhaps someone could > suggest an alternative method if we knew why you needed percentage > (just a thought)
Sometimes you need to know the style values in units other than px, for example em, ex and %. > On Feb 16, 3:34 am, ryan <[email protected]> wrote: > > > Nope - it always returns pixels in safari and firefox ... but I need > > percent. > > > On Feb 15, 11:42 pm, Iain <[email protected]> wrote: > > > > $( 'myElement' ).getStyle( 'width' ) should return the correct value, > > > whether it is in pixels or percent. > > > > On Feb 15, 2:44 am, ryan <[email protected]> wrote: > > > > > Hello > > > > > MooTools very helpfully converts all widths to pixel values, which 99% > > > > of the time is what I want. However, just this once I need to know > > > > what the original % width is. Is there any way of getting it? > > > > > When i do something like el.style.width it just returns a blank value > > > > in Firefox and Safari... which isnt helpful. The element has already > > > > been wrapped in $() if that affects anything... > > > > > All suggestions gratefully received! > > > > > Ryan > >
