Results 1 to 2 of 2

Thread: not able to get correct browser height

  1. #1
    Join Date
    Apr 2011

    not able to get correct browser height

    Hi Everyone,

    I am using javascript to find the browser window's innerheight and outerheight(ie both document body + task bar ,statusbar,menubar etc)I am using the following command for the

    calculation of the above thing

    var browserOuterheight;
    var browserInnerHeight;
    var browserWidth;
    var yCordinate;
    var xCordinate;

    if (typeof (window.outerHeight) == 'number') {
    browserOuterheight = window.outerHeight;
    alert("browserOuterheight " + browserOuterheight)
    browserInnerHeight = window.innerHeight;
    alert("browserInnerHeight " + browserInnerHeight)
    yCordinate = browserOuterheight - browserInnerHeight;
    alert("yCordinate" + yCordinate);
    xCordinate = 1

    This one works perfectly for the following browser's GoogleChrome,Safari,Firefox with small problem on Firefox

    Following is the problem

    The window.outerheight and window.innerHeight returns different values ,
    a)when the script is run locally on the same browser
    b)when the script is run after publishing the page on the server and ran from the same browser.

    This issues do not come for other browser except firefox.For other browser the outerheight and innerheight comes same, before and after the script is published on the server.

    The firefox browser version used is : firfox 3.6.16
    Os is Windows Xp

    Best Regards,
    Sagar Singh

  2. #2
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    Pardon my bewilderment, but why do you want to know/change/control the browser's (my browser's, if I could be your client) size.

    Why do you need that? Moreover, what in fact you need to know? The size of the viewport? Or the browser's? Or the document's?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center