PDA

View Full Version : More Versitile


Crash1hd
03-28-2003, 09:35 AM
I was wondering if there would be a better way to do this maybe something more versitile that gives the same output without useing Tables if at all possible!


<html><head><title>New Page 1</title>
<script>
OP = (window.opera);
NN4 = (document.layers);

function loadHandler() {
if (NN4 || OP) {
origWidth = this.innerWidth;
origHeight = this.innerHeight;
if (OP) resizeHandler();
}
}

function resizeHandler() {
if (this.innerWidth != origWidth || this.innerHeight != origHeight)
location.reload();
if (OP) setTimeout('resizeHandler()',500);
}
if (NN4) onresize = resizeHandler;
</script>
</head>
<body onLoad="loadHandler();" onResize="location.reload();">
<script>
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var op = window.opera

if(ie || w3) {
a_w=document.body.clientWidth;
a_h=document.body.clientHeight;
}
if(ns || op) {
a_w=innerWidth;
a_h=innerHeight;
}

document.write('<div style="position:absolute; visibility:show; font-family:arial; font-size:10pt;')
if (a_h >= 0) if (a_h <= 99) document.write('width: 450; height: 145; clip:rect(0,450,145,0);');
if (a_h >= 100) if (a_h <= 299) document.write('width: 450; height: 265; clip:rect(0,450,265,0);');
if (a_h >= 300) if (a_h <= 599) document.write('width: 450; height: 445; clip:rect(0,450,445,0);');
if (a_h >= 600) if (a_h <= 1200) document.write('width: 450; height: 675; clip:rect(0,450,675,0);');

document.write('Z-Index: 1; background-color:#CCCCCC; layer-background-color:#CCCCCC">')

document.write(a_h)
document.write('<br>')
document.write(a_w)
document.write('</div>')
</script>
</body>
</html>

glenngv
03-28-2003, 10:00 AM
it's not using a table but a div
if you don't want the div, just remove the div part like this:

<html><head><title>New Page 1</title>
<script>
OP = (window.opera);
NN4 = (document.layers);

function loadHandler() {
if (NN4 || OP) {
origWidth = this.innerWidth;
origHeight = this.innerHeight;
if (OP) resizeHandler();
}
}

function resizeHandler() {
if (this.innerWidth != origWidth || this.innerHeight != origHeight)
location.reload();
if (OP) setTimeout('resizeHandler()',500);
}
if (NN4) onresize = resizeHandler;
</script>
</head>
<body onLoad="loadHandler();" onResize="location.reload();">
<script>
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var op = window.opera

if(ie || w3) {
a_w=document.body.clientWidth;
a_h=document.body.clientHeight;
}
if(ns || op) {
a_w=innerWidth;
a_h=innerHeight;
}

document.write(a_h)
document.write('<br>')
document.write(a_w)

</script>
</body>
</html>

Crash1hd
03-28-2003, 10:10 AM
ok but I need the div part thats where all the info goes basically I am wanting what ever is in the div to change size acording to the browser size

glenngv
03-28-2003, 10:17 AM
do you mean like this?

<html>
<body>
<div style="width:100%;height:100%;background-color:silver">
blah<br>
blah<br>
blah<br>
blah<br>
blah<br>
blah<br>
blah<br>
blah
</div>
</body>
</html>

Crash1hd
03-28-2003, 10:36 AM
I am such an idiot lol I dont know why I didnt think of useing percentages before!