Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-04-2009, 04:48 PM   PM User | #1
frdxon23s
New to the CF scene

 
Join Date: Jan 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
frdxon23s is an unknown quantity at this point
Question How to hide a div on a page

Hello Guys,

I am using a cms and need to hide a div on certain pages was wondering how I would hide the div #sidebar for instance.

I can only seem to find the hide/show code so any help is much appreciated.
frdxon23s is offline   Reply With Quote
Old 04-04-2009, 04:51 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough


Read the posting guidelines (specifically point 3) before posting here. We need more info than “I’m using a CMS and want to hide a div”.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 04-04-2009, 04:59 PM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello frdxon23s,
display:none; would hide it but still leave the space it takes occupied.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 04-04-2009, 05:02 PM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by Excavator
display:none; would hide it but still leave the space it takes occupied.
I think this issue is not with the display:none, but with visibility:hidden
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 04-04-2009, 05:09 PM   PM User | #5
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
I'll be watching this thread to see. I've never had call to hide anything before, maybe I'll learn something.
More info from the OP would help, link us to the test site so we can see what your hiding.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 04-04-2009, 05:17 PM   PM User | #6
TinyScript
Regular Coder

 
Join Date: Mar 2009
Location: Portland Oregon
Posts: 690
Thanks: 44
Thanked 63 Times in 62 Posts
TinyScript is on a distinguished road
do you think it's joomla? or Drupal?

the suspense is killing me!
LOL
TinyScript is offline   Reply With Quote
Old 04-04-2009, 06:03 PM   PM User | #7
TinyScript
Regular Coder

 
Join Date: Mar 2009
Location: Portland Oregon
Posts: 690
Thanks: 44
Thanked 63 Times in 62 Posts
TinyScript is on a distinguished road
this is how you can hide or show the sidebar, if that's the id name
you can trigger a function or something
Code:
document.getElementById("sidebar").style.visibility="hidden" ;/*hides the element*/

document.getElementById("sidebar").style.visibility="visible" ;/*shows the element*/
here's an example of using this technique. open the menu and click on the friends online section on the bottom and a little window shows up.
http://h1.ripway.com/stirfry/javascr...thfriends.html

Last edited by TinyScript; 04-04-2009 at 06:10 PM.. Reason: added link example
TinyScript is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:25 PM.


Advertisement
Log in to turn off these ads.