Results 1 to 2 of 2

Thread: control div on other page

  1. #1
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default control div on other page

    Hello,

    I was wondering if it is possible to control a div on another page.
    For instance:

    When you work with 2 iframes, is it possible to show a page in the first iframe, when there is a link clicked in the second?

    Not that i want to do the above example, but just to make it clear for you all.

    thanks,
    Dennis,
    the Netherlands

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Hmm. That seems like two different questions. Well, the first part (controlling a div in another frame):

    Controling iframes is possible using javascript. You would need to reference the frame you want to manipulate in a similar way to how you would reference a div or span tag. Here is an example taken from this tutorial:

    Code:
    function ShowWebSite(val)
    {
          document.all.myFrame.src=val;
          document.all.myFrame.style.visibility="visible";
    }
    Read the tutorial for more.

    As for linking, put a target in the anchor tag. ie:
    Code:
    <a href="SomeSite.com" target="MyFrame">Click Me!</a>
    By default the target is "_top" if I am not mistaken, which tell the browser to change the whole page. You can also have the link open in a new window with the target, but popup blockers usually don't allow that.
    Last edited by Jas; 02-04-2008 at 07:33 PM.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

Bookmarks

Posting Permissions

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