[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread Stephan Beal
On Aug 22, 3:49 pm, duma <[EMAIL PROTECTED]> wrote: > If you're talking about accessing the included stylesheets, you certainly can > do that by accessing document.styleSheets. ... > document.styleSheets is part of the DOM Level 1 standard. The CSSStyleSheet > object is DOM Level 2. That may be,

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread duma
Yes, if all you're after is the Css properties, then just create the element and analyze it with jQuery directly, without inserting it into your document. Sean Gordon-35 wrote: > > > That's what I have been doing up to now, it just feels really > inelegant to be doing it that way. I was hop

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread Gordon
That's what I have been doing up to now, it just feels really inelegant to be doing it that way. I was hoping that there would be a way to get CSS properties of an element without having to put an example into the DOM first On Aug 22, 2:53 pm, duma <[EMAIL PROTECTED]> wrote: > If you're after th

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread Gordon
You can't use display:none to hide an element while you determine it's dimensions, because while it is in that state it doesn't have any. It has to have a display that puts it in the DOM, so the only way to keep it invisible is to use visibility: hidden On Aug 22, 2:39 pm, Stephan Beal <[EMAIL P

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread duma
If you're after the Css-defined width and height parameters of an element, it seems to me you could just create the element and then do $(elt).css("width") and $(elt).css("height"). If you're after the actual rendered size of an element, then one way I know would work would be to set its display

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread duma
If you're talking about accessing the included stylesheets, you certainly can do that by accessing document.styleSheets. document.styleSheets returns an array of CSSStyleSheet objects. This object provides the methods addRule and deleteRule. document.styleSheets is part of the DOM Level 1 stan

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread Stephan Beal
On Aug 22, 1:58 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Stephan Beal wrote: > > FYI: visibility:hidden is different than visibility:none. 'hidden', > > according to Eric Meyers' O'Reilly book, acts as if the element is ... > Do not mix up visibility and display properties. There is no value o

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread Klaus Hartl
Stephan Beal wrote: On Aug 22, 11:42 am, Gordon <[EMAIL PROTECTED]> wrote: flickering occurs. You can mitigate the flickering problem by making sure the elements you add to the dome have a css ('visibility', 'hidden') but that still leaves the other problems. FYI: visibility:hidden is differe

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread Karl Rudd
You'll want to do something like this: var elem = $(''); elem.css({position:'absolute', visibility:'hidden'}).appendTo( someParent ); var something = elem.css('something'); // and when you want to finally show it elem.css({position:'', visibility:''}); This is basically the way that jQuery gets

[jQuery] Re: Get size for elements that don't exist yet

2007-08-22 Thread Stephan Beal
On Aug 22, 11:42 am, Gordon <[EMAIL PROTECTED]> wrote: > flickering occurs. You can mitigate the flickering problem by making > sure the elements you add to the dome have a css ('visibility', > 'hidden') but that still leaves the other problems. FYI: visibility:hidden is different than visibility