Web Analytics Made Easy -
StatCounter How to hide a div on a page - CodingForum

Announcement

Collapse
No announcement yet.

How to hide a div on a page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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


    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”.
    Stop solving problems you don’t yet have!

    Comment


    • #3
      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 a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

      Comment


      • #4
        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
        Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

        Comment


        • #5
          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 a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

          Comment


          • #6
            do you think it's joomla? or Drupal?

            the suspense is killing me!
            LOL

            Comment


            • #7
              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; Apr 4, 2009, 01:10 PM. Reason: added link example

              Comment

              Working...
              X