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 5 of 5

Thread: A Dynamic Page?

  1. #1
    Junior Member ClemmyProd's Avatar
    Join Date
    Aug 2005
    Posts
    5
    Member #
    11146
    I have been doing some reading on a couple websites and a couple sources given to me. I am just going to ask for some guidance. I am poking around here and it is kind of overwhelming because I am not 100% sure what exactly I am looking for.

    Basically, I have set up in CSS some containers one which contains a list of links, and I was wondering if there is anyway I can have it set up so that the page the user is currently on changes when he clicks a link on the page. I was thinking having the information in one of the divs change. I have looked at W3Schools, which thus far has been the most helpful, but because I am not 100% sure the methods I should use to go about doing this; it is an overwhelming amount of knowledge.

    I was wondering if anyone could help me by pointing me in a direction.

  2.  

  3. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    Let me understand this better: when a user clicks a link, do you want the page to change or just the text?

    Best practice dictates that the page changes (that is, the URL actually changes), not the page text.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  4. #3
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    You could use css for this, that is, clicking a link which shows new content.

    First off you will hide the content, then when a link is clicked you can show or display it.

    This can be done with JavaScript also.

  5. #4
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    Here is a simple trick:
    HTML Code:
    <html>
    <head>
    <title>Div change</title>
    <script type="text/javascript">
    //<![CDATA
    var current = 'div1' //holds the currently open div
    clink = 'link1' //currently used link
    function changec(too,link)
    {
    document.getElementById(current).style.display = 'none' 
    document.getElementById(too).style.display = 'block'
    document.getElementById(clink).style.fontWeight = 'normal' 
    document.getElementById(link).style.fontWeight = 'bold'
    
    /*replace display = 'none' with visibility = 'hidden' 
    and display = 'block' with visibility='visible' of there are problums
    */
    current = too
    clink = link
    }
    //]]>
    </script>
    </head>
    <body>
    <ul>
    <li id="link1" style="font-weight:bold"><a href="javascript:changec('div1','link1')">div 1</a></li>
    <li id="link2"><a href="javascript:changec('div2','link2')">div 2</a>
    <div id="div1">THIS WILL SHOW UP TO START</div>
    <div id="div2" style="display:none;">
    <!--Change style="display:none; to style="visibility:none;" if changed above-->
    HIDDEN UNTILL LINK CLICKED
    </div>
    </body>
    </html>
    this should work
    Thee Pyro Wolf

  6. #5
    Senior Member MoRpHeUs's Avatar
    Join Date
    Apr 2005
    Location
    UHS-VILLE
    Posts
    139
    Member #
    9568
    u sure that's right pyro, it looks off....i could just be me....

    I'm not here for you, I'm here to raise your discomfort


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 07:44 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com