Results 1 to 4 of 4

Thread: show/hide comments body

  1. #1
    Join Date
    Sep 2007
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default show/hide comments body

    Hi .
    I'm trying to make a collapsible/expandable comments on PHP .
    I hope im asking it in the right place
    I'm trying to make something that if someone posts a comment with content on it it can be expanded to see the content .
    and if a user didnt post any content its going to write no content and wont expand.
    can someone help me with that please.
    <script>
    n = 3; // number of hidden layers
    function show(a){
    for(i=1;i<=n;i++){
    document.getElementById('t'+i).style.display = 'none';
    }
    document.getElementById('t'+a).style.display = 'inline';
    }
    </script>
    this script is kinda good but it wont collapse the comments on another click on it. it does do another thing i want which is to collapse other open comments body when clicking on a different comment.
    maybe someone else using something like that on his site and can help me.
    maybe on a more pro script that would maybe get the content off the db when clicking on the comment head and show the content.
    thank you.
    flash.

  2. #2
    Join Date
    Dec 2006
    Location
    http://andersmoen.com
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What does this have to do with PHP?

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

  4. #4
    Join Date
    Sep 2007
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    yeah I'm sorry I wasnt sure where to ask..
    I'm gonna try the script you linked me with now , Thank you.

Bookmarks

Posting Permissions

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