Pretty comments
Feb 01
UPDATE: Please refer to this post for support/updates on prettyComments
Here’s a small jQuery plugin that allow textareas to strech as content is put in. If the content goes over the defined height of the textarea, the textarea will stretch.
So no need to more scroll up in that cramped space to take a look at what you wrote 10 lines before.
It’s really easy to use, just download the file pretty-comments.js and include it in the html page where you want to allow the comment box stretching. Then put that bit of code in that same page to include the script:
<script src=“the-path/js/pretty-comments.js” type=“text/javascript” charset=“utf-8″></script>
You can then play a bit with the options which are located at the top of the javascript file, you can define if you want to have it animated or not and the speed of the animation.
Then put that bit of code in the same page you have your comment box, you need to pass the comment box id as a parameter for it to work.
<script type=”text/javascript” charset=”utf-8″>
$(document).ready(function(){
prettyComments.init(’comment’);
});
</script>
That’s really all there’s to it, if you want a demo, just leave a comment, you’ll see the box stretch
Files: Un-compressed (3kb,options)
Packed (1kb, animated, no options)
Demo: Right in that page, just enter a lot of content in the comment box.
If you notice any bug, need any support, just leave a comment, I’ll do my best to help you!
Note: You also need the jQuery library in order to use this plugin
Update: Version: 1.1 relased! Now the textarea can shrink back to it’s original size when you delete content from it!
