The CSS you've quoted is defining a rule for elements with *class*
"foo", not `id` foo, and your quoted test code is using `getHeight`,
not `getWidth`.

If I make the rule for the `id` "foo" and use `getWidth` and Prototype, it works for me on Safari 5, IE6, IE7, and IE9 on Windows;
and Chrome (let's see, what is it today) 10, Firefox 3.6, and Opera 11
on Linux: http://jsbin.com/uhofu4

So either it's a "feature" of RC2, or something that only shows up on
a Mac (if that's where you're using Safari), or maybe a couple of the
issues with the quoted test code are actually present in the code
you're testing. Or something else. :-)

T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Mar 20, 4:24 pm, Walter Lee Davis <wa...@wdstudio.com> wrote:
> I'm using 1.7 rc2 (don't have access to a later version at the moment)
> and it seems like getWidth is only counting the width, and not
> including the border width. The documentation hints that it should
> return the width of the element's layout box.
> .foo {
>     border: 1px solid black;
>     width: 498px;}
> <div id="foo">bar</div>
> $('foo').getHeight() --> 498 in Safari 5.latest
> I think it should be 500. Is this just a factor of the version I'm
> using, or is it how it's supposed to work?
> Walter

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to