Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Apr 2005
    Posts
    1
    Member #
    9604
    Hi All,
    I am relatively new to HTML. I am currently doing a site based on frames. There is a main frame at the top of the page, one at the side for menus and a content one to display the main content.

    When I click buttons on the top bar I need for it to call different pages within the frames on both the menu column and the content page...

    Is there any way a link can call two pages or maybe if the link called one page and that page then opened the other?

    Many Thanks

  2.  

  3. #2
    Member
    Join Date
    Jan 2005
    Posts
    97
    Member #
    8727
    Javascript I think, along the lines of onLoad='javascript:menu.location="page.html"'. I'm not terribly sure, but it should be like that.

  4. #3
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    You can do it with javascript. Basically, the link would call a function that would then change the URL (document.location) property of each frame.

    As for actual details, one thing to think about: should the link at the top bar change both frames or should it change the contents frame and then the contents frame loads the new menu? Personally, I suggest having the latter (serial) approach.

    It's past midnight, so I won't attempt writing the code off the top of my head right now. Try the following:

    http://www.google.co.uk/search?hl=en...G=Search&meta=

    http://www.google.co.uk/search?q=win...G=Search&hl=en

    And in particular, I think this page is quite useful:
    http://tech.irt.org/articles/js013/
    See their example at the very end. It's exactly what you want

    Hope this helps. Good night.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  5. #4
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    javascript would be your best bet i can think of two ways
    1)a function call:
    Code:
      function changec(page1,page2) 
    {
    frame1.location = page1
    frame2.location = page2
    //be sure to repace frame1 and frame2 with names specified in frame document
    }
    then to call the function you would do the following:
    HTML Code:
    <a href="javascript:changec('page1','page2')">name here</a>
    or
    an onload event like so
    HTML Code:
     <body onload="frame2.location='the page'">
    and link to the document with the event
    Thee Pyro Wolf

  6. #5
    Junior Member ahkar1's Avatar
    Join Date
    Apr 2005
    Location
    St. Louis, Missouri
    Posts
    6
    Member #
    9607
    Im thinking your best bet would be not to build a frames site. The search engines hate them and they are not very effiecient to upgrade. Just a thought.

  7. #6
    Senior Member audiofreak9's Avatar
    Join Date
    Apr 2005
    Location
    NJ
    Posts
    339
    Member #
    9584
    I am by no means an expert, but here is a site I did for a local hockey web site with exactly what you are asking for. I placed the javascript into a .js file to keep the html cleaner. Clicking the links on the left on the page changes three framed pages. The first frame is just the animated picture lower left, it froze when a link was clicked so I reload it. The second is the black submenu (again animated gifs YUCK!) The third is the content page. I used frames because I was not worried about search engines, everyone involved with the league knew the web address, and I submitted the main entry page for easy searching to the search engines.

    BTW please be kind this is a youth site and the client insisted on scrolling banners and animated gifs :ermm:

    Check out the page here to see the links at work:
    www.ehtsha.com/home.htm

    Then look at the javascript file:
    www.ehtsha.com/script/hockey.js

    Use the following placed between the HEAD tags to call the javascript file.

    Code:
    <SCRIPT LANGUAGE="javascript" src="FILENAME.js" TYPE="text/javascript"></script>
    Where FILENAME is your javascript filename.

    The GENERIC javascript in the form of a FILENAME.js file that does the work is:

    Code:
    <!----hide
    function change()
    {
    self.FRAME_NAME1.location="YOUR_NEW_PAGE1.htm";
    self.FRAME_NAME2.location="YOUR_NEW_PAGE2.htm";
    }
    //------>
    Change the YOUR_NEW_PAGE1 to your page to be loaded in frame one after the link is clicked.
    Change the YOUR_NEW_PAGE2 to your page to be loaded in frame two after the link is clicked.

    For two frames the GENERIC html iframe coding is as follows:

    Code:
    <IFRAME src="FRAME1_INITIAL_PAGE.htm" name="FRAME_NAME1"></IFRAME>
    <IFRAME src="FRAME2_INITIAL_PAGE.htm" name="FRAME_NAME2"></IFRAME>
    Change the FRAME1_INITIAL_PAGE to the page you want to initially show in frame 1.
    Change the FRAME2_INITIAL_PAGE to the page you want to initially show in frame 2.

    The GENERIC html link coding is as follows:

    Code:
    <a href="javascript:change()">Link</a>
    Add more javascript functions as detailed above for more links changing the function change() name, i use change1(), change2(), etc...

    This is mostly like polydragon's example.

  8. #7
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    i like the idea although it has a similer concept it allows you to have seperet .js files keeping the code neat
    Thee Pyro Wolf

  9. #8
    Senior Member audiofreak9's Avatar
    Join Date
    Apr 2005
    Location
    NJ
    Posts
    339
    Member #
    9584
    Hey pyrodragon could you PM me with the code for the seperate .js file? I'd love to give it a look...
    Thanks!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:19 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com