创建输入自动完成功能非常实用的脚本:At.js
At.js - 非常实用的脚本用于创建输入自动完成功能 (使用 Emojify 的示例).
$('.atwho-inputor').atwho({ at: "@", data: ["one", "two", "three"], });
还有一个库叫Typehead来自推ter也实现了同样功能。
特性
- Support IE 7+ for textarea.
- Supports HTML5 contentEditable elements (NOT include IE 8)
- Can listen to any character and not just '@'. Can set up multiple listeners for different characters with different behavior and data
- Listener events can be bound to multiple inputors.
- Format returned data using templates
- Keyboard controls in addition to mouse
Tab
orEnter
keys select the valueUp
andDown
navigate between values (andCtrl-P
andCtrl-N
also)Right
andleft
will re-search the keyword.
- Custom data handlers and template renderers using a group of configurable callbacks
- Supports AMD </ul>
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!