Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    24

    Unanswered: I need some javascript help

    I hope this is the right forum..

    I need to open a window, and resize and reposition it in the onload() event. When I do this, the window opens in one location, and then jumps to the new location.

    how can I prevent the "jump" from being so visible?

    the code is :

    function loadv() // called from the onload event.
    {

    if (document.all.VSel.value=="2") {

    var t = document.all.tblData;

    var iw;
    if (navigator.appName == "Netscape") {
    iw = window.parent.window.opener.window.innerWidth;
    }
    else {
    iw=window.parent.window.opener.window.document.bod y.clientWidth;
    }

    window.resizeTo(t.offsetLeft + t.offsetWidth+50, t.offsetHeight + t.offsetTop + 50);

    var w;
    if (navigator.appName == "Netscape") {
    w = window.innerWidth;
    }
    else {
    w=document.body.clientWidth;
    }

    var l=(window.parent.window.opener.window.screenLeft + iw)-w;
    window.moveBy(l, window.screenTop);
    }
    window.focus();
    }

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    This is actually the ASP forum, not JS, but here's my idea.. on the onLoad event, you launch the new window, then set the focus on the parent window to bring it back to the front covering your new window while it resizes and adjusts it's location, then sets the focus back on the child window after the window alteration is complete.

    Never tried it, but another idea might be to try to set the size of the window to be really small, do the window location adjustment, then the resize...
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Jul 2004
    Posts
    24
    I tried both ideas - setting focus to the parent window while the window resizes, and setting the window size to a very small size - none of them worked!
    Thanks anyway.
    maybe i'll try the js group..

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Did they not work, or not work as expected?
    That which does not kill me postpones the inevitable.

Posting Permissions

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