創建輸入自動完成功能非常實用的腳本: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.
</ul>
</li>
- Custom data handlers and template renderers using a group of configurable callbacks
- Supports AMD </ul>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!