Old 22-02-2007, 17:47   #1 (permalink)
Chunk
Registered User
 
Chunk's Avatar
 
Join Date: Jan 2007
Location: East London
Posts: 62
Send a message via Yahoo to Chunk
links between 2 divs

Hi peeps, can anyone pls help me...

i have 2 divs vertically lined on the left of the page. in the lower div i have links and in the upper div a bit of text (intro/summary shit). what i want to be able to do is that when a link in the lower div is clicked, the text in the upper div changes. so the intro text disapears and text for the clicked link appears in its place.

i've tried using anchor tags, it makes the new text (for the clicked link) appear in the upper div, but not right at the top of it, and the intro text is still there, except for the first line which has been pushed out (i wanted it all to be pushed out of the div and only show the new text - same thing to happen for every link clicked).

overflow for the upper div is set to hidden. also has no scrollbars (how i would prefer to keep it). upper div is 230px wide and 200 high.

any help will be much appreciated!

cheers,
chunk
  Reply With Quote
Old 22-02-2007, 17:54   #2 (permalink)
Jack000
I ride polar bears
 
Jack000's Avatar
 
Join Date: Oct 2006
Location: the good part of Canada
Posts: 170
use a script like jQuery

it'll look something like:

$("a#link1").click(function(){
$("#top_div").text("this is some text");
});
  Reply With Quote
Old 23-02-2007, 05:10   #3 (permalink)
Chunk
Registered User
 
Chunk's Avatar
 
Join Date: Jan 2007
Location: East London
Posts: 62
Send a message via Yahoo to Chunk
cheers jack, i'll give it a go!
  Reply With Quote
Old 23-02-2007, 05:24   #4 (permalink)
funkyprem
For all your goober needs
 
funkyprem's Avatar
 
Join Date: Dec 2004
Location: Coventry, UK
Posts: 1,529
javascript and innerHTML??
__________________
Time is really the only capital that any human being has, and the one thing that he can’t afford to lose. - Thomas Edison

prem ghinde
  Reply With Quote
Old 23-02-2007, 05:39   #5 (permalink)
Chunk
Registered User
 
Chunk's Avatar
 
Join Date: Jan 2007
Location: East London
Posts: 62
Send a message via Yahoo to Chunk
the jquery thing isnt what im looking for... any way with just css. no iframes or java...

anyone??
  Reply With Quote
Old 23-02-2007, 05:54   #6 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
just wrap each section in a div and give that a height of 200px, should do what you need.
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote
Old 23-02-2007, 06:50   #7 (permalink)
Chunk
Registered User
 
Chunk's Avatar
 
Join Date: Jan 2007
Location: East London
Posts: 62
Send a message via Yahoo to Chunk
thanks for all the replies guys.

stickmus ur a fuckin legend squire, works perfect!
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8