"Csaba2000" <news (AT) CsabaGabor (DOT) com> wrote
Quote:
I apologize for the length of the page below, but I've tried
to whittle it down as much as I can. |
60 lines isn't a long script, that's perfectly acceptable in a regular
post (beyond ~300 lines I believe that a link is better).
Quote:
Netscape 6.1 on my Win 2K Pro machine is disappearing
the final row of the table. |
I don't have NN6.1 here so cannot reproduce the problem (nor represent
it I'm afraid), but give a look at the following suggestions...
You've got an array eventually, so you'd better use a normal iterator
rather than the for..in construction.
Incorrect here, "max" is filled with a double, while you need a string
and the appropriate css postfix:
myDiv.style.width = max + "px"
(and IIRC NN6.1 was affected by this)
Quote:
BODY style="height:100%;padding:0;margin:0;border:solid 1px red"
onLoad='allButtonsUniform(document.forms[0])' |
Better to use a CSS block declarations rather than inline declarations
IMHO, you'd gain in readibility.
As for your TEXTAREA sizing issue, I'm not sure of what the best
solution could be, maybe resize it according to the screen height and
its relative position, something like the following gives usable
results on IE6, Mozilla1.3 and Opera 7 (provided I've understood your
issue correctly), less the pre-load temp sizing (very important for
non-supporting UAs; the load delay might be a pain too).
<style type="text/css">html,body{margin:0;padding:0}</style>
<textarea id="foo"></textarea>
<script type="text/javascript">
function getPageHeight(w) {
var d=(w||(w=window)).document;
if(typeof w.innerHeight=="number") return w.innerHeight;
else if(d.documentElement && d.documentElement.clientHeight &&
d.compatMode && d.compatMode=="CSS1Compat")
return d.documentElement.clientHeight;
else if(d.body && d.body.clientHeight) return d.body.clientHeight;
return 0;
}
function getYPos(elem) {
var y=0;
if (typeof elem.offsetTop=="number")
do y += elem.offsetTop;
while (elem = elem.offsetParent);
return y;
}
window.onload = function (evt) {
if(document.getElementById) {
var ta = document.getElementById("foo"),
taTop = getYPos(ta),
winHeight = getPageHeight();
ta.style.height = (winHeight - taTop) + "px";
}
}
</script>
Regards,
Yep.