View Full Version : Links to change text on page, not open new page??
ksk386
03-25-2009, 12:23 PM
Hi,
I'm trying to recreate this twitter page.
http://twitter.com/about#about
I want all my links to change the text in the body section of my page. I don't want new windows to pop up.
I have a fixed header, body and footer and I want to change the body text. I don't need to wory about scrolling.
I'm thinking i want to know how to replace div text with new divs...or is there a div text replacement when i click on a link?
I love this place here and thanks for any help.
Ksk
bluewalrus
03-25-2009, 01:10 PM
They use...
<li><a href="#idea" id="toggle_idea">Where did the idea for Twitter come from?</a></li>
<div id="idea" style="display:none">
<h3>Where did the idea for Twitter come from?</h3>
<p>Jack Dorsey had grown interested in the simple idea of being able to know what his friends were doing. Specifically, Jack wondered if there might be an opportunity to build something compelling around this simple status concept. When he brought the idea up to his colleagues, it was decided that a prototype should be built.</p>
<p>Twitter was funded initially by Obvious, a creative environment in San Francisco, CA. The first prototype was built in two weeks in March 2006 and launched publicly in August of 2006. The service grew popular very quickly and it soon made sense for Twitter to move outside of Obvious. In May 2007, Twitter Incorporated was founded.</p>
</div>
and I think this file http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js
ksk386
03-25-2009, 01:43 PM
Thanks blue.
Now I'm kinda new at this, although with that said, I must say I was doing html before most even know what the web was...since 96 or so...but i gave up after I graduated...dumb me...man where would I be today if I stayed ahead of the curve...anyway.
Now...I'm back and learning CSS.
I love this stuff. I'll give it a whirl. So i'm going to need to open that ajax file to actually see how the do the swap portion of this script is that it?
I fear I may be treding lightly...
Thanks Blue and I'll prob be trying this out.
ksk386
03-25-2009, 02:37 PM
Dang! What the heck is all that stuff in that .js file? i have no idea what that all is. It can't be the code to make the text swap...really? Dang.
ksk386
03-25-2009, 03:09 PM
Ahh i see a java script file...cool! Lots of coding though.
bluewalrus
03-26-2009, 01:36 AM
yea i believe that's actually a library (or something like that) with multiple functions in it.
Master_script_maker
03-27-2009, 01:17 AM
for something so simple, don't use a library. try one of the solutions in this thread: http://www.dynamicdrive.com/forums/showthread.php?t=42998
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.