Uh, allright, I'm sorry...I guess I found a solution.
The trick is to wrap the content in a span, and then retrieve the
spans height.
But still, I guess if contents().height() (which sounds so logical to
retrieve the contents height, don't you think) works in Internet
Explorer it should work in Firefox as well (or it shouldn't give any
nasty exceptions, at least)...

If someone got an even easier way than the span-wrapping I'd be glad
to hear about!

On 31 Jan., 22:14, Sebioff <[EMAIL PROTECTED]> wrote:
> Hi,
> i've got a div with overflow:auto.
> I want to check whether the content of the div is higher than the div
> itself (in order to know whether I need to show a "scroll down" link
> or not).
>
> In Internet Explorer with jQuery 1.2.2. I can get the contents height
> without any problem with:
> $("#div").contents().height()
>
> (I don't know if this is the best way to do it, but it's the only one
> I found...)
> The problem is, in Firefox it doesn't work and all I get is the
> following error message:
>
> Fehler: [Exception... "Could not convert JavaScript argument"
> nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS
> frame ::http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js::
> anonymous :: line 853"  data: no]
> Quelldatei:http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js
> Zeile: 853
>
> You can try it out yourself 
> here:http://www.rakuun.de/Stuff/Schasler/content_height_test.html
>
> Any idea how to fix this or how to get the contents height in a way
> that works in both browsers?

Reply via email to