原文地址:http://docs.jquery.com/Plugins/Autocomplete/autocomplete
autocomplete
( url or data, [
options]
)
Options:
autoFill
Boolean
|
Default:
false
|
Fill the textinput while still selecting a value, replacing the value if more is typed or something else is selected. |
cacheLength
Number
|
Default:
10
|
The
number of backend query results to store in cache. If set to 1 (the
current result), no caching will happen. Must be >= 1. |
delay
Number
|
Default:
400 for remote, 10 for local
|
The delay in milliseconds the autocompleter waits after a keystroke to activate itself. |
extraParams
Object
|
|
Extra
parameters for the backend. If you were to specify { bar:4 }, the
autocompleter would call my_autocomplete_backend.php?q=foo&bar=4
(assuming the input box contains "foo"). The param can be a function
that is called to calculate the param before each request. |
formatItem
Function
|
Default:
Assumes that a single row contains a single value.
|
Provides
advanced markup for an item. For each row of results, this function
will be called. The returned value will be displayed inside an LI
element in the results list. Autocompleter will provide 4 parameters:
the results row, the position of the row in the list of results
(starting at 1), the number of items in the list of results and the
search term. |
formatMatch
Function
|
Default:
formatItem is used
|
Use
this option if you want to limit the data that autocomplete searches
for matches. For example, there may be items you want displayed to the
user, but don't want included in the data that's searched. Gets called
with the same arguments as formatItem. |
formatResult
Function
|
Default:
Assumes either plain data to use as result or uses the same value as provided by formatItem.
|
Similar
to formatItem, but provides the formatting for the value to be put into
the input field. Again three arguments: Data, position (starting with
one) and total number of data. |
highlight
Boolean
, Function
|
Default:
Wraps the search term in a <strong> Element
|
Whether
and how to highlight matches in the select box. Set to false to
disable. Set to a function to customize. The function gets the value as
the first argument and the search term as the second and must return the
formatted value. |
matchCase
Boolean
|
Default:
false
|
Whether or not the comparison is case sensitive. Important only if you use caching. |
matchContains
Boolean
|
Default:
false
|
Whether
or not the comparison looks inside (i.e. does "ba" match "foo bar") the
search results. Important only if you use caching. Don't mix with
autofill. |
matchSubset
Boolean
|
Default:
true
|
Whether
or not the autocompleter can use a cache for more specific queries.
This means that all matches of "foot" are a subset of all matches for
"foo". Usually this is true, and using this options decreases server
load and increases performance. Only useful with cacheLength settings
bigger than one, like 10. |
max
Number
|
Default:
10
|
Limit the number of items in the select box. Is also sent as a "limit" parameter with a remote request. |
minChars
Number
|
Default:
1
|
The minimum number of characters a user has to type before the autocompleter activates. |
multiple
Boolean
|
Default:
false
|
Whether to allow more than one autocompleted-value to enter. |
multipleSeparator
String
|
Default:
", "
|
Seperator to put between values when using multiple option. |
mustMatch
Boolean
|
Default:
false
|
If
set to true, the autocompleter will only allow results that are
presented by the backend. Note that illegal values result in an empty
input box. |
scroll
Boolean
|
Default:
true
|
Whether to scroll when more results than configured via scrollHeight are available. |
scrollHeight
Number
|
Default:
180
|
height of scrolled autocomplete control in pixels |
selectFirst
Boolean
|
Default:
true
|
If
this is set to true, the first autocomplete value will be automatically
selected on tab/return, even if it has not been handpicked by keyboard
or mouse action. If there is a handpicked (highlighted) result, that
result will take precedence. |
width
Number
|
Default:
width of the input Element
|
Specify a custom width for the select box. |
分享到:
相关推荐
`jquery.autocomplete.js`是jQuery的一个插件,它扩展了原生的jQuery库,增加了自动完成的功能。这个插件主要由两个核心部分组成:一个是前端展示部分,负责渲染和展示联想结果;另一个是数据处理部分,用于获取和...
标题中的“Jquery插件的使用--AutoComplete”指的是jQuery中的一个插件——AutoComplete,它主要用于实现输入框的自动补全功能,提高用户输入的效率和体验。这个插件通常用于搜索框或者任何需要根据用户输入动态提供...
在本篇关于“JQuery开发9-用户输入自动提示功能”的主题中,我们将深入探讨如何使用jQuery库来实现一种常见的Web交互功能——自动提示(Autocomplete)。这种功能常见于搜索框、表单输入等场景,当用户在输入框中...
综上所述,jQuery Autocomplete插件为开发者提供了灵活、易用的自动完成功能,通过定制各种参数和事件,可以满足各种复杂的用户交互需求。结合HTML文件(如`2.html`)中的实际布局和结构,可以创建出更符合应用场景...
《jQuery UI与jQuery插件深度解析——以jquery-ui-1.8.2.custom.min.js为例》 在Web开发领域,jQuery库以其简洁易用的API和强大的功能深受开发者喜爱。而jQuery UI作为jQuery的一个扩展,提供了丰富的用户界面组件...
在"jquery文本框自动提示"这个主题中,我们主要关注的是如何利用jQuery来实现一种常见且实用的功能——输入框的自动提示,也就是常说的自动补全(Autocomplete)功能。这种功能通常用于提升用户界面的交互性和效率,...
2. **插件开发原理**:jQuery插件通常包含两个主要部分——一个函数定义和$.fn.extend()调用。函数定义是插件的主体,扩展了jQuery原型链,使其具备新的功能。例如: ```javascript (function($){ $.fn.myPlugin ...
【前端项目-jquery.postcodify.zip】是一个包含前端开发资源的压缩包,主要涉及的是一个基于jQuery的插件——Postcodify。这个插件专为韩国的地理信息搜索设计,目的是帮助用户方便地查找韩国的街道地址和邮政编码。...
7.5 搜索插件AutoComplete /209 7.6 图片灯箱插件notesforlightbox /213 7.7 右键菜单插件contextmenu /216 7.8 图片放大镜插件jqzoom /222 7.9 自定义jQuery插件/224 7.9.1 插件的种类/225 7.9.2 插件开发...
7. **自动完成(Autocomplete)**:为输入框提供自动补全功能,提高用户输入效率,常见于搜索框或表单填写。 8. **特效(Effects)**:包含基本动画、过渡和复合效果,如淡入淡出、滑动、切换等,为网站增添动态视觉...
本篇文章将详细讲解一个基于jQuery的特殊插件——"jQuery带分页的下拉选择框插件",该插件在传统下拉选择框的基础上增加了丰富的功能,如自动补全、分页、多选以及键盘操作,极大地提升了用户体验。 首先,我们来看...
除了基本的搜索功能,jquery.search.select还可以与其他jQuery插件结合,如Autocomplete或Typehead,以实现更复杂的搜索体验。同时,由于其源码结构清晰,开发者也可以根据需要进行二次开发,添加新的功能。 总结来...
标题“jquery标签回车自动完成特效代码”涉及的是使用jQuery库实现的一种常见前端交互功能——自动完成(Autocomplete)效果,特别是在输入框中输入内容时,通过回车键触发建议列表的显示。jQuery是一个轻量级的...
6. **下拉菜单(AutoComplete)**: 在输入框中提供自动完成功能,常用于搜索或表单填写。 7. **滑块(Slider)**: 用于创建水平或垂直的滑动条,常用于调整音量、亮度等数值。 8. **进度条(Progressbar)**: 显示任务的...
JavaScript库,如Select2、iCheck或jQuery UI的Autocomplete,都提供了实现这一功能的插件。这些组件支持搜索、无限滚动、自定义渲染等功能,极大地提升了用户体验。 特别的是,这个组件还声称是“最好用”的,这...