Entry
How do I find the computed dimensions of a SELECT?
Apr 20th, 2000 03:02
Martin Honnen,
NN6 and IE4+ provide the
offsetWidth
offsetHeight
for this. NN4 has no comparable properties so unless you stuff your
SELECT in a single FORM you stuff into a layer you can't measure the
dimensions.
Here is the NN6/IE4+ example:
<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM NAME="formName">
<SELECT NAME="aSelect"
ONCLICK="alert(this.offsetWidth + ':' + this.offsetHeight);"
>
<OPTION>Kibology
<OPTION>Visit JavaScript.FAQTs.com for all your JavaScript Questions
</SELECT>
</FORM>
</BODY>
</HTML>