Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Frames

  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Frames

    I have 2 frames. I need to be able to click a button in one window, and have it change both.

    Also, is it possible to have a mouse over in frame 2 run a script that changes something in frame 1?

    Thanks.
    If I'm postin here, I NEED YOUR HELP!!

  • #2
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    947
    Thanks
    0
    Thanked 130 Times in 129 Posts
    if you want to load a new page in both frames
    you can use this:

    <input type="button" value="Click here" onClick="LoadNewPages()">
    or
    <a href="javascript:LoadNewPages()">Click here</a>

    and the script for that is:

    function LoadNewPages(){
    parent.theotherframe.location.href="new.htm";
    location.href="new.htm";
    }

    --------------------

    if for example you want to change the backgroundcolor of the other page
    you can use this:

    <input type="button" value="Click here" onClick="ChangeBGcolor()">
    or
    <a href="javascript:ChangeBGcolor()">Click here</a>

    and the script for that is:

    function ChangeBGcolor(){
    parent.theotherframe.document.bgcolor="FF0000";
    }

  • #3
    New to the CF scene
    Join Date
    Aug 2005
    Location
    West Coast, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That should work...

    I remember reading somthing about it at:

    http://www.webmonkey.com

    goto search and look up frames...

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,521
    Thanks
    3
    Thanked 507 Times in 494 Posts
    Operate across frames in a frameset via the 'top' or 'parent'

    therefor to change two frames
    Code:
    onclick="window.top.frame1.location='One.htm';window.top.frame2.location='Two.htm';"
    where frame1 and frame2 are the frame names specified in the frameset


  •  

    Posting Permissions

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