View Full Version : (HELP) truncate comments for each user

03-18-2007, 10:59 PM

I wanted to know if someone knows any script that will truncate a users comment to maximum 300 words and then when you click on "read more" it will show the whole comment and when you click again it will bring it back to 300 words. Like lets say a truncate function combined with a toggle +/-.

Below is the URL to my demo truncate function but that only works once like you click on "Read more" and it will show the whole comment but then you cannot switch back to 300 words. Also I want so when you click on one comment to read more, any other comment you have clicked will close it back to 300 words.


Hope you understand.

Thanks alot

03-20-2007, 01:02 AM
Take a look at this script. It's close to what you're asking for, I think. When you click on one, the other open ones collapse. Or you can open or close all of them at once.


03-20-2007, 06:59 PM
I know I have checked that one out but it doesn't do everything :(.

I have the javascript function that does about 75% of the work. It truncates the comment to 200 words and then when you click on "readmore" it shows the rest of the comment but what it does not have is the ability to close it back to 200 words/or it should close back when you click on another comment. If someone could alter my code to do that it would be great.

check out the demo and you will know what I mean.