Results 1 to 4 of 4

Thread: JAVASCRPIT - position a page in the middle of the frame

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98

    Question JAVASCRPIT - position a page in the middle of the frame

    Here is what I have:

    The window.htm contains this code:

    <HTML>
    <HEAD>
    </head>
    <frameset rows="100%,0">
    <frame name="Top" src="Frame1.htm">
    <frame name="Bottom" src="about:blank">

    <noframes>
    <body>

    <p>This page uses frames, but your browser doesn't support them.</p>


    </noframes>
    </frameset>

    This window as you can see contains two frames. Frame1.htm contains:

    <SCRIPT language=JavaScript>
    function showFrame() {
    window.parent.document.all.tags("Frameset")(0).rows = "30%,70%";
    }
    function hideFrame() {
    top.document.all.tags("Frameset")(0).rows = "100%,0";
    }
    function ProjectFrame() {
    top.frames(1).location.href = "http://Test/Proj1/Project1.htm"
    }


    Those are my two javascript functions. Here is the code where I call the function ShowFrame and ProjectFrame:


    <script ID="clientEventHandlersJS" LANGUAGE="javascript">

    function ctrlInp_Click(txtParam)
    {

    var X = txtParam;
    ResetValues();

    if (X == "Hello")
    {
    showFrame();
    ProjectFrame();
    }

    If the value in my activex control is = Hello then Showthe bottom frame and display the page in it with Project1.htm

    At this Point I want Frame1.htm to display its document at the middle of the frame

    Hopefully this will give you better a look at what I am trying to do...

  2. #2
    scoutt
    Guest
    so the <a name=hello> still applies.
    Code:
    top.frames(1).location.href = "http://Test/Proj1/Project1.htm#hello
    then in your project1.htm file. you would put <a name=hello> where ever you want it to be. if you put this in the begining of the page it would start there, but if you put it in the middle it would start in the middle. do you understand now??

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98
    Thank you for your pateince and assistance!

  4. #4
    scoutt
    Guest
    no prob, let me know if that works

Posting Permissions

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



Click Here to Expand Forum to Full Width