Textarea without scrollbar
Hi I do want to create a tex开发者_如何学运维tarea without scrollbar just like in facebook and twitter, and the creation of the textarea that changes its height when we click on it. thank you
If you are looking to use jQuery, there is a plugin called autoResize
Usage is simple:
$('textarea#comment').autoResize({
// On resize:
onResize : function() {
$(this).css({opacity:0.8});
},
// After resize:
animateCallback : function() {
$(this).css({opacity:1});
},
// Quite slow animation:
animateDuration : 300,
// More extra space:
extraSpace : 40
});
Grab this plugin here: http://james.padolsey.com/javascript/jquery-plugin-autoresize/
You can find an explanation over here http://www.dazecoop.com/22-10-2008/jquery-textarea-auto-grow-auto-height you just need to get the plugin ;)
精彩评论