Best method to show/hide content?

Discussion in 'HTML & Website Design' started by mark_s, Jan 7, 2008.

  1. #1
    I want to use a script that allows content on my site to be collapsed until the user wants to see it.

    I'm currently using a bit of javascript that does this but the problem is the content initially loads and then later hides once the page is fully downloaded. This is bad if I want to hide a photo or something.

    On another site I've seen them use javascript but it also uses CSS display: none and I'm not keen on using that in fear of Google penalising me.

    Can someone suggest the best method to show/hide content that is not risky in Google terms?
     
    mark_s, Jan 7, 2008 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    CSS none is the normal way to do it. Another option is to use serverside code so that it is only present on the client side when it is to be displayed (with or without using Ajax to reveal it) but then you potentially make the page slower and/ or increase bandwidth usage
     
    AstarothSolutions, Jan 7, 2008 IP
  3. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I thought using CSS:none was risky as Google doesn't like you hiding content with that method.
     
    mark_s, Jan 7, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    There is a risk that search engines will consider it spam but as no one outside of Google etc knows the exact algorythms used it is purely speculation on if it actually would or wouldnt.
     
    AstarothSolutions, Jan 7, 2008 IP
  5. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Then to me it sounds like AJAX would be the best way...
     
    mark_s, Jan 7, 2008 IP