-
\\\JS and netscape help///
Hi, I am trying to find two things:
i) the width of the page window (not the screen.width) IE the size of a window, someone may have it only half as wide as their monitor...
ii) the height of the web page or body or whatever.
It was be amazingly fantastic if you could enlighten me - or a tip.
M@
-
Senior Member
1. self.outerWidth , self.outerHeight
2. self.innerWidth , self.innerHeight
Additional for the second, when using frames it's not bad to use: self.screen.availWidth and self.screen.availHeight that works in IE, too
hope it helps...
-
NETSCAPE 4.x
Hi, I am trying to set an image on my page to be the same as the height (not window.height) of the whole html page.
I can access the height of the page (not window) using:
document.height
Great! - or so I thought.
What I need to do now is set the height of an image to be equal to 'document.height'.
This can be done in a number of ways (I hope).
One method is putting the following code in the page:
<script language="JavaScript">
images = new Array
images[1] = "/images/tiny_invisible.gif";
var myimage = images[1]
document.write('<IMG src="' + myimage + '" width=1 height='+document.height+' border="1" alt="">')
</script>
The problem here is that it will only set its height to the height of the page above it, rather than the whole page. - this make sense as the rest of the page hasn't rendered yet, and therefore won't have a height.
What I need is something that is called one the page has initialised. So, as far as I see that leaves only <body onload="function();">
So, I used the function:
<SCRIPT LANGUAGE="JavaScript1.2">
<!--//
function gettheheight() { //v3.0
alert('document.height= '+document.height);
}//-->
</script>
Whoohay, now I have the total page height. All that remains is to set the height of an image on the page to be this height.
Easier said than done.
Initially, I tried the following:
Function:
<SCRIPT LANGUAGE="JavaScript1.2">
<!--//
function gettheheight() { //v3.0
document.myimage.height=document.height;
}//-->
</script>
And in the page:
<img src="image.gif" width="20" height="20" border="1" vspace="0" name="myimage">
Needless to say this didn't work. I have tried, I have read stuff. Now I'm going to the experts.
Is there anything that can be done to get this to work on netscape 4.x?
Any effort is hugely appreciated - been trying for a week.
M@
Last edited by Game_on; 12-24-2002 at 10:32 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|