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
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    load content in three divs

    I would like to do the following.
    When I click on a link I want to load three different sets of content into three different divs on my page. For example clicking on a menu link at the top of my page loads 1. a new image in the header div 2. a new submenu in the navigation div 3. new content in my main content div.

    Any help would be greatly appreciated.

    thanks

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,535
    Thanks
    3
    Thanked 513 Times in 500 Posts
    divobject.innerHTML='limited HTML Code';


    or using existing elements

    divobject.appendChild(exisitingelement.cloneNode(true));

    or if all objects ane defined in the div

    specifiedobject.display='none';
    specifiedobject.display='';


    but need to know more about you application for best method.
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well here's some more detail if it will help. I want to layout a page in my site so that across the top there are a few menu options (say 5 of them) contained within a div. When the user clicks on one of them there are 3 things that change.

    1. a graphic in a div below the menu changes
    2. a new sub menu appears in a left-hand div below the graphic
    3. content related to the sub menu appears in a right-hand div along side the sub menu.

    Then as the user navigates through the sub menu on the left only the block of content on the right changes while the sub nav, graphic above, and main nav above the graphic remain static.

    lots of commercial site seem to do this though I don't know quite how to do it with divs (they often use frames or iframes).

    Do-able?

    thanks

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,535
    Thanks
    3
    Thanked 513 Times in 500 Posts
    they often use frames or iframes
    so that the data is stored on a number of pages.

    if you store all the data on a single page it becomes too large and difficult to maintain.
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

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