开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜