Closed Thread Icon

Topic awaiting preservation: possible NN bug with innerWidth/innerHeight? (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=8079" title="Pages that link to Topic awaiting preservation: possible NN bug with innerWidth/innerHeight? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: possible NN bug with innerWidth/innerHeight? <span class="small">(Page 1 of 1)</span>\

 
hecster2k
Nervous Wreck (II) Inmate

From: sj, ca, usa
Insane since: Feb 2002

posted posted 02-15-2002 17:46

I'm still working on that taskbar that's bottom-aligned. it's 100% wide, 30px high. in IE, getting the clientHeight takes into consideration the horizontal and/or vertical scrollbars (if any) and places the bar right above it. on netscape and mozilla, it aligns it to the bottom, but the innerHeight does not take into consideration the scrollbars.

another problem i'm having is on all platforms:
the taskbar is aligned to the bottom, and the vertical scrollbar shows up. the way i'm calculating the div.top value is by getting the clientWidth - 30 + offsetX;

any help would be appreciated! thanks

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-15-2002 20:27

A link would help me

Later,
C:\


~Binary is best~

hecster2k
Nervous Wreck (II) Inmate

From: sj, ca, usa
Insane since: Feb 2002

posted posted 02-16-2002 00:57

how's this (i don't have it publicly accessible at this time):

----------------------------------------------------------------------------
<html>
<head>
<title>Untitled</title>
<style>
#floaterDiv {position:absolute; left:0px; width:100%; height:30px; background-color:000000; overflow:none}
</style>
</head>

<body>
<p>content here <p>content here <p>content here <p>content here <p>content here <p>content here <p>content here
<p>content here <p>content here <p>content here <p>content here <p>content here <p>content here <p>content here
<p>content here <p>content here <p>content here <p>content here <p>content here <p>content here <p>content here
<p>content here <p>content here <p>content here <p>content here <p>content here <p>content here <p>content here

<div id="floaterDiv" style="position:absolute; width:100%; height:30px">
<table width="100%" cellpadding=0 cellspacing=0 border=0>
<tr>
<td align="right">
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</td>
<td>
<select>
<option>1.1</option>
<option>1.2</option>
<option>1.3</option>
</select>
</td>
<td>
Logout
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>

<script>
var i, doc_width = 0, doc_height = 0;
var browser=navigator.appName;
var version=navigator.appVersion;

var NS = (document.layers) ? 1 : 0;
var IE = (document.all) ? 1 : 0;


var offsetX, offsetY;
var layerstart = "";
var layerleft = "";
var layertop = "";
var layerstyle = "";
var layer_noStyle = "";

function initFloater() {

if (NS) {
layerstart = "document.";
layerleft = ".left";
layertop = ".top";
layerstyle = "";
layer_noStyle = "";
doc_width = "self.innerWidth";
doc_height = "self.innerHeight";
offsetX = "window.pageXOffset";
offsetY = "window.pageYOffset";
} else if (IE) {
layerstart = "document.all.";
layerleft = ".left";
layertop = ".top";
layerstyle = ".style";
layer_noStyle = "";
doc_width = "document.body.clientWidth";
doc_height = "document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
} else {
layerstart = "document.getElementById('";
layerleft = ".left";
layertop = ".top";
layerstyle = "').style";
layer_noStyle = "')";
doc_width = "window.innerWidth";
doc_height = "window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}

}


function checkLocation()
{
var availableX = eval(doc_width);
var availableY = eval(doc_height);
var currentX = eval(offsetX);
var currentY = eval(offsetY);

divY = parseInt(eval(layerstart + "floaterDiv" + layerstyle + ".height"));
divWidth = availableX + currentX;
x = currentX;
y = availableY - divY + currentY ;
if (IE) evalMove();
window.status = "currentX:" + currentX + ", currentY: " + currentY + ", availableX: " + availableX + ", availableY: " + availableY ;
setTimeout("checkLocation()",10);

}

function evalMove() {
eval(layerstart + "floaterDiv" + layerstyle + ".width=" + divWidth);
eval(layerstart + "floaterDiv" + layerstyle + layerleft + "=" + x);
eval(layerstart + "floaterDiv" + layerstyle + layertop + "=" + y);
}
initFloater();
checkLocation();
</script>

</body>
</html>
----------------------------------------------------------------------------

« BackwardsOnwards »

Show Forum Drop Down Menu