CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 20th, 2004, 03:31 PM
newbe newbe is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: NY
Posts: 2 newbe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hide/Show text using CSS

I am very new to css. I am trying to show and hide text by clicking a button. My intention is to use this in a threaded discussion board.
For example
I'd like the topics to be displyed when the page loads
1) topic 1 (Open/Close)
2) topic 2 (Open/Close)

On hitting the Open button this would be something like this:

1) topic 1 (Open/Close)
---message 1
---message 2
---message 3
---message 4

2) topic 2 (Open/Close)

Hope someone can suggest me an answer or point me to one.

Thanks

Reply With Quote
  #2  
Old January 21st, 2004, 06:51 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
You can't just use CSS to do this alone, but controlling CSS with javascript you can.

Use the display property of css - none removes it from the document flow altogether, block makes it appear in a block (standard display for divs, tables, h tags etc.)

So you could have

<div id="topic1" style="display: none;">
TEXT
TEXT
</div>

And a little javascript function which does this

function showDiv() {
document.getElementById('topic1').style.display = String ('block');
}

You should be able to ammend that to your needs.

-D

Reply With Quote
  #3  
Old February 24th, 2004, 11:20 AM
newbe newbe is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: NY
Posts: 2 newbe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you

Don't remeber if I thanked you for ths. But it worked out perfectly for me. Thank you for taking the time to help out.

Maneesha

Reply With Quote
  #4  
Old February 24th, 2004, 11:10 PM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,555 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 7 h 49 m 53 sec
Reputation Power: 630
Here's an example using CSS. The code will degrade gracefully for non-graphic UAs such as Lynx or assistive technology for the handicapped.

cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

Ask a better question, get a better answer.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Hide/Show text using CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway