什么是jQuery的自动完成插件中的catcomplete? [英] What is catcomplete in jQuery's autocomplete plugin?

查看:278
本文介绍了什么是jQuery的自动完成插件中的catcomplete?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JQuery UI自动完成插件使用 catcomplete 函数。我是JQuery语法的新手,你能帮我理解如何阅读吗?

The JQuery UI autocomplete plugin uses the catcomplete function. I'm new to the JQuery syntax, can you help me to understand how to read it?

$("#searchTextBox").catcomplete({
    minLength: 1,
    source: $("#searchTextBox").data("url"),
    open: function () {
        $(".ui-autocomplete").css({
            left: $(".ui-autocomplete").position().left - 50 + "px",
            top: $(".ui-autocomplete").position().top - 12 + "px"
        });
    },
    select: function (event, ui) {
        /*code*/
    }
});


推荐答案


什么是catcomplete?

What is catcomplete?

catcomplete 是一个出现在jQuery对象上的属性。它不是核心jQuery的一部分,因此可能在页面上添加了一些其他脚本。

catcomplete is a property that appears on jQuery objects. It is not part of core jQuery so there is presumably some other script on the page that is adding it.


jQuery的自动完成如何调用它?

How does jQuery's autocomplete call it?

我找不到自动填充文档中任何地方提到的 catcomplete ,所以它可能没有。它只修改了页面中元素的CSS,其中的类名表明它们通常受自动完成的影响。

I can't find catcomplete mentioned anywhere in the documentation for autocomplete, so it probably doesn't. It just modifies the CSS of elements in the page with class names that suggest they are normally influenced by autocomplete.


什么是minLength,source,打开并选择?

What are minLength, source, open and select?

作为参数传递给 catcomplete 的对象的属性完成功能。您应该阅读catcomplete文档以了解它们的含义。

Properties of the object that gets passed as an argument to the catcomplete complete function. You should read the catcomplete documentation to find out what they mean.


谁决定了他们的名字?

Who decided their name?

catcomplete的作者

The author(s) of catcomplete


代码的哪一部分知道如何使用它们?

Which part of the code knows how to use them?

catcomplete脚本

The catcomplete script


他们是标准jQuery的一部分?

Are they a part of standard jQuery?

否。


catcomplete是函数吗?

Is catcomplete a function?

是的,它有(...)之后调用它并且(可能)不会抛出异常。

Yes, it has (…) after it to call it and does not (presumably) throw an exception.


什么是 $(# searchTextBox)。示例({})?在做什么?我是否定义了一个数组并将其传递给名为Example的函数?

What is $("#searchTextBox").Example({})? doing? Am I defining an array and passing it to a function called Example?

否。您正在创建一个对象。数组将是 []

No. You are creating an object. An array would be [].


或者我是否定义了一个名为Example的函数来初始化一个匿名数组?

Or am I defining a function called Example which initializes an anonymous Array?

没有。那将是:

function Example() {
    var foo = [];
}

这篇关于什么是jQuery的自动完成插件中的catcomplete?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆