Yes, still need to show the element if it is hidden, but instead of checking for ":visible" just checking for "display:none"
The if statement passes through values that you might be setting. 500 or '400px' or "100%" On Feb 13, 5:10 pm, John Resig <jere...@gmail.com> wrote: > > On Fri, 2009-02-13 at 16:25 -0500, John Resig wrote: > >> 3) Why does $.size exist? Why not just have the functionality be in > >> .height()/.width() - or in .curCSS(). I don't see a need for a new > >> function here. > > > I think this is important to have: when calling .height()/.width() > > we have to show the element to measuring it, and this makes it > > twice as slow to get both the height/width. On large elements > > this can bring the time down to 500ms from 1s. Big improvement. > > Umm - unless I'm missing something that hasn't changed - in $.size > there are the following lines: > > 59 if ( $.curCSS( elem, "display" )!='none' ) getSize(); > 60 // swap element layout, then calculate value > 61 else $.swap( elem, { > 62 position: "absolute", visibility: "hidden", display: > "block" > 63 }, getSize ); > > So it's still showing the element just like before. Is there something > that I'm missing here? > > Another point that I'm confused about in the code is this line: > 36 if ( arg==undefined||arg=='padding'||arg=='border'||arg=='margin' > ){ > > That seems like every case - what's the point of the if statement? > > --John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---