#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    3
    Rep Power
    0

    Javascript window height


    Hi, I'm using this code to determine the window width and height of a visitor to my page, but after I have the values os winW and winH, how can I use them in a tag for setting a table width and height?

    Basically I have a table on my page that I would like to fit the window properly when someone visits my page, I'm just not sure how to use the values in my html after I got them from a javascript. Thanks

    Chris

    Code to find window height and width :

    var winW = 630, winH = 460;

    if (parseInt(navigator.appVersion)>3) {
    if (navigator.appName=="Netscape") {
    winW = window.innerWidth;
    winH = window.innerHeight;
    }
    if (navigator.appName.indexOf("Microsoft")!=-1) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
    }
    }

    document.write(
    "Window width = "+winW+"<br>"
    +"Window height = "+winH
    )
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    3
    Rep Power
    0
    Thanks, I'll try posting there

IMN logo majestic logo threadwatch logo seochat tools logo