PDA

View Full Version : show/hide comments body



flash
11-27-2007, 06:15 AM
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.

andersmoen
11-27-2007, 02:32 PM
What does this have to do with PHP? :)

boogyman
11-27-2007, 02:41 PM
http://www.dynamicdrive.com/forums/showthread.php?t=23788

flash
11-28-2007, 06:47 AM
yeah I'm sorry I wasnt sure where to ask..
I'm gonna try the script you linked me with now , Thank you.