开发者

Textarea without scrollbar

开发者 https://www.devze.com 2023-01-27 17:26 出处:网络
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.

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 ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号