Just curious... What if I increase the font size in my browser? Will the borders remain the fixed size your class creates or will it behave like the relative size of it's "mother" and get larger? I may be completely missing the boat ...
On Mar 12, 10:04 pm, Sebastian Markbåge <sebast...@calyptus.se> wrote: > Now that I think about it, my code in getStylePx() should just be a > patch for getComputedSize(). getContentSize() is not necessary then. > > Element.snapshot() could be a nice addition though. > > On Mar 13, 4:39 am, Sebastian Markbåge <sebast...@calyptus.se> wrote: > > > > > There are situations where it's useful to be able to work with the > > fixed values of element font-sizes, dimensions etc. MooTools does this > > quite nicely in most situations. However, if you use a lot of relative > > sizing in your CSS designs there can sneak up some issues here and > > there. This is really mostly due to IE's poor computed styles > > implementation and rounding of relative values. I've done some work on > > a few additional extensions that might be useful. > > >http://clientside.svn.calyptus.se/JavaScript/Native/Element.Style.Px.js > > > It adds getStylePx() and getContentSize(). But these could easily be > > made unnecessary by implementing the code from getStylePx() into the > > regular getStyle() method and using the new Element.getComputedSize() > > instead of getContentSize(). Or at least have getComputedSize() use > > getStylePx instead. > > > This all adds up to the Element.snapshot(...) method. This works just > > like Element.clone(...) with the difference that it sets relative > > styles to fixed so that you can reuse the element on another place in > > your document with a consistent style. > > > I use this to create ghost clones of elements during drag and drop > > operations. > > > There are some minor quirks with font-size and rounding in IE and font- > > weight in Firefox in some special circumstances. > > > I might be a good complement to the excellent new Element extensions. > > Thoughts?