Hi
I have a weird bug with getHeight or getDimensions().hegiht
(prototype) only on safari
if I have a html file like this
<div id="test"></div>
and a embedded css
<style>
#test {
width:100px;
height:100px;
float:left;
}
</style>
In Safari $(''test'').getHeight returns 100, fine but if the css
declaration #test.. is in a css file included by a <link
href="stylet.css" rel="stylesheet" type="text/css"
></link>
The height is 0!!
Is it something known, is there a workaround?
Thanks
Seb
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060508/4a925552/attachment.html
> In Safari $(''test'').getHeight returns 100, fine but if the css > declaration #test.. is in a css file included by a <link > href="stylet.css" rel="stylesheet" type="text/css" ></link> > The height is 0!!Since your height is defined in the css and not inline, it''s not an page attribute that your javascript can read. if you did: <div id="thething" style="height: 100px;">thing</div> it would work. In this case you could do: height = $(''thething'').getHeight; This is not just a Safari issue. Thx! -- Posted via http://www.ruby-forum.com/.
> if you did: > > <div id="thething" style="height: 100px;">thing</div> > > it would work. In this case you could do: > > height = $(''thething'').getHeight; > > This is not just a Safari issue. > > Thx!Hmmm. didn''t actually know what getHeight did so I looked it up, that function returns the offsetHeight of an element, not the height defined by your css (thing.style.height). you could do: $(''thething'').style.height; instead. http://www.quirksmode.org/viewport/compatibility.html -- Posted via http://www.ruby-forum.com/.