Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Content Height
- From: javascript at webdesignofficina.com (Guillaume)
- Subject: [Javascript] Content Height
- Date: Tue Oct 31 03:47:48 2006
I would use /offsetHeight /to know the height of the div and then
substract paddings, margins and borders of the div...
This way you would have the size of your content...
Something like...
var opts1 = document.getElementById("options");
opts1H = opts1.offsetHeight;
opts2H = opts1 - 10; // 5px top and bottom margin value for example.
opts3H = opts2H - 10; // 5px top and bottom padding value for example.
opts4H = opts3H - 2; // 1px top and bottom margin value for example
opts5H = opts4H + "px";
Details about offsetheight property can be readed here:
http://developer.mozilla.org/en/docs/DOM:element.offsetHeight
Hope this helps...
Guillaume.
> What function I use to know the height of the content of a div, even
> if the div has a cursor
>
> Thanks
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Javascript mailing list
>Javascript@xxxxxxxxxx
>https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.LaTech.edu/pipermail/javascript/attachments/20061031/77c05778/attachment.html
- References:
- [Javascript] Content Height
- From: Diego Chagastelles
- [Javascript] Content Height
- Prev by Date: [Javascript] Content Height
- Previous by thread: [Javascript] Content Height
- Index(es):