微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jQuery growfield

程序名称:jQuery growfield

授权协议: 未知

操作系统: 未知

开发语言:

jQuery growfield 介绍

Style-independent cross-browser jQuery textarea autogrow plugin

Successfully tested in: FF2 (vista, xp, mac, linux), IE6 (xp), IE7 (vista,
xp), Opera 9.2 (xp, mac), Opera 9.5 (vista), Safari 3 (mac, xp).

Comments and fixes are very appreciated.
optional parameters // $(elem).growfield( options )

  • auto - bool // default = true // if false, ctrl + up/down are enabled
  • animate - bool // default = true
  • before(jEvent), after(jEvent) - callbacks // ‘this’ will be the dom object
  • min - integer - height in pixels // default = min ? css.min-height || initial height
  • max - integer - height in pixels // maximum size // default = css.max-height || none
  • restore - bool - restore original size on blur (and back to growed on focus) // default = false
  • speed - integer - animation speed. not a jquery parameter // default = 300 (ms)

additional functions (public interface)

  • $(..).increase( step )
  • decrease( step )
  • growTo( height )
  • growToggleAuto( bool )
  • growToggleRestore( bool )
  • growSetMin( integer )
  • growSetMax( integer )

notes

parameters may be set in html attributes // tag attributes have priority

increase and decrease functions are working only in auto mode
opera:

in opera, if you don’t have border style for textarea, plugin will set it
(opera hides borders in overflow:hidden mode). in auto mode it won’t work at
all. More than that, opera returns border:2px solid #00000 even if you don’t
set it. :(
kNown problems:

after restore (onfocus) with animation textarea sometimes looses cursor. :( //
ff2, ie7xp

when reached maximum height, opera will jitter on every keydown :( // opera <
9.5
ctrl + up/down:

in opera and ie this shortcut doesn’t work properly. But you may use ctrl +
whatever + up/down.

Download here:
http://code.google.com/p/jquery-growfield/downloads/list

jQuery growfield 官网

http://plugins.jquery.com/project/Growfield

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐