Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,786
    Thanks
    6
    Thanked 1,022 Times in 995 Posts


    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”.

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    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
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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

  • #6
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts
    do you think it's joomla? or Drupal?

    the suspense is killing me!
    LOL

  • #7
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •