I am trying to accomplish a 'more' tag with Tumblr. So, if there are x amount of characters/words in a class then it only displays x amount of characters and adds a 'more' tag at the end.

When the more tag link is clicked it should display the other text, like a collapsable div etc.

I have googled a few scripts, but all require you to enclose the text you want hidden in a div etc, however the tumblr 'html view' for posting strips all css information, so the calculations need to be made in the main document or just with javascript as it doesn't strip away javascript code.

I hope this is making sense. Any help would be greatly appreciated.