For continued disscussion on this topic : Getting the height in a NN4 Layer
I need to get the actual height of the layer("div"), how do I do it. The height is varying so I need to get the current one. IE and Netscape compatible.
Thanks
Michel
07-03-2000, 07:04 AM
Refer to your other post.
I know I could get the height using "eval(document.all['X'].style.height)" but this gives the default value but not the current height value of the layer.
I need also to know on how to check if there is an overflow of content on the layer. I'm using this so that I could scroll up and down the clip. I do not want to use the overflow:scroll funtionality coz it doesn't look good. I have done the scrolling part, and now I need to know when this functionality should function and when should not and that by knowing when the layer has an overflow.
Michel
07-03-2000, 09:53 AM
By "height" I thought you meant the clip value that you would get from "top". Sorry, my mistake.
First of all, as far as I´m aware you can´t check whether a clipped area has overflow or not.
Secondly, since the overflow-property isn´t supported by NN it effectivly eliminates that as a cross browser tool, even if it is possible to do such a check in IE (again, I don´t know if you can).
Thirdly, for some reason it seems you can´t set the height property dynamically in NN, only the clip values. That means that you have to set the height as a fixed value and then play with clipping for changing the height.
I´m not sure what you mean by "default value" as opposed to the "current height value", but unless your working in IE the height value will always be the same (as explained above).
I'm sorry I was't clear with my terms?
By default value, I mean the predefined value when you create the layer, while when I say current value is the new height value when content is added on the layer.
thanks
Michel
07-03-2000, 11:22 AM
You might be in for some trouble then.
The problem is that in IE you always get the asigned value, not the "true" height, no matter if the value is asigned in the div-tag or through scripting.
In NN it is possible to read the momentary height: one of the rare cases where NN has more functionality.
How do you get the momentary height on NN?
I think it's better to work on one browser than none at all...
thanks in advance...
Michel
07-07-2000, 08:11 AM
You can get the height of the layer by asking for the bottom side of a clip. You can obtain this value even if you haven´t clipped your layers or specifed the height.
To see it in action, copy and paste the code below (NN only). Note that the height hasn´t been defined anywhere.
<HTML>
<HEAD>
<SCRIPT>
function init() {
if(document.layers) {
alert("height layer 1: "+document.layers.x.clip.bottom);
alert("height layer 2: "+document.layers.y.clip.bottom);
}
}
</SCRIPT>
</HEAD>
<BODY onLoad="init()">
<DIV ID="x" STYLE="position:absolute; background:yellow">THIS TEXT IS INSIDE LAYER 1</DIV>
<DIV ID="y" STYLE="position:absolute; top:50px; width:20px; background:green">THIS TEXT IS INSIDE LAYER 2</DIV>
</BODY>
</HTML>
:)
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.