dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Open a new window and resize initial page

  1. #1
    Join Date
    Apr 2009
    Posts
    24

    Exclamation Open a new window and resize initial page

    What I am trying to do is to open a new window and the page I am on opens another page. I have managed to do this and the new window is the size I want it to be as shown in code below. What I want to do is resize the initial page I click the link on to fit in the remaining screen area that the window is not in. Is this possible and do you use javascript for it? Any help on the matter would be much appreciated. Thanks in advance


    Here is my code

    <html>
    <head>
    </head><body>


    <script type="text/javascript">
    var mywindow;
    window.onload=function(){
    document.getElementById('two_links').onclick=function() {
    twoSites();
    }
    }
    function twoSites() {
    url='./documents/otherpage.html';
    w=700;
    h=4000;
    l=(screen.width-w);
    t=(screen.height-h)/2;

    features='width='+w+',height='+h+',left='+l+',top='+t, resizable='yes';
    if(mywindow) {
    mywindow.close();
    }
    mywindow=window.open(url,'',features);
    mywindow.focus();
    }

    </script>


    <div>
    <a id="two_links" href="firstpage.html" >

    Open First Page and <span>Other Page</span>
    </a>
    </div>
    </body></html>

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    You need a script inside "firstpage.html" that resizes the window. Look at http://www.javascripter.net/faq/resizing.htm.

Thread Information

Users Browsing this Thread

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

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



Recent Articles