A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: \\\JS and netscape help///

  1. #1
    Random logic?
    Join Date
    Oct 2000
    Posts
    410

    \\\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@

  2. #2
    Senior Member sxdesign's Avatar
    Join Date
    Aug 2000
    Location
    Serbia
    Posts
    844
    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...

  3. #3
    Random logic?
    Join Date
    Oct 2000
    Posts
    410
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center