JavaScript jQuery plugin: Elastic

miclle · February 12, 2012 · Last by nightire replied at March 24, 2012 · 2953 hits

项目里有用到 textarea 需要自增高的效果,之前有使用 http://unwrongest.com/projects/elastic/ 这一个,但觉得不喜欢他在 textarea 后面用一个 div 那样的方式,ruby-china 用的 plugin 也类似,只是 div 挪到了最后面,一直尝试能不能只通过 textarea 自身来实现,所以周末也写了一个,代码很简单!目前只在 Chrome 下测试!

https://github.com/miclle/jQuery-Plugins/tree/master/elastic

太好了。正打算写一个这样的东西,先看看你的。

精神可嘉! 不过这个问题全世界已经纠结好久了,基于兼容性的考虑,Shadow DIV 还是最好的处理办法。 当然,LZ 如果能另辟蹊径那是最好,大致看了一下源代码,hard code 有点多,重用性不太好啊⋯⋯

You need to Sign in before reply, if you don't have an account, please Sign up first.