object width and browser compatibility

Discussion in 'Javascript' started by David McDivitt, Dec 23, 2006.

  1. At the URL http://www.spfldcycling.org/miles.htm , I'm having difficulty
    resizing a DIV object when the window resizes. I want to get the left and
    top positions of the DIV, then calculate the width and height. I can get the
    window dimensions fine, but since I can't get the left and top I had to use
    constants, which isn't a good idea. Also, the page doesn't work well in
    Netscape. The header shifts all the way to the right on top of the empty
    corner cell, and the name list sometimes disappears and comes back again if
    resized in the other axis. IE is fine. If someone could look at this and
    give me suggestions I'd appreciate it. The function with constants is pasted
    below.

    The page is created by a VB6 program and uploaded via FTP. I put it out with
    a debug switch set, so extra spaces and line feeds are included. If the
    records keeper uploads again, those will go away, but for the time being the
    page source can be easily read.

    function redraw() {
    if (dd) {
    var ww=f_clientWidth();
    var wh=f_clientHeight();
    if (ww<500) ww=500;
    if (wh<500) wh=500;
    dd.style.width=ww-160;
    dd.style.height=wh-175;
    hh.style.width=ww-175;
    nn.style.height=wh-190;
    }
    }

    dd is set at the end of the page by:

    var hh=document.getElementById('head');
    var nn=document.getElementById('names');
    var dd=document.getElementById('detail');
     
    David McDivitt, Dec 23, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.