如何删除/更改 JQuery UI 自动完成助手文本? [英] How to remove/change JQuery UI Autocomplete Helper text?

查看:19
本文介绍了如何删除/更改 JQuery UI 自动完成助手文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个好像是JQuery UI 1.9.0的新功能,因为之前用过很多次JQuery UI,一直没有弹出这个文字.

It seems that this is a new feature in JQuery UI 1.9.0, because I used JQuery UI plenty of times before and this text never poped up.

在 API 文档中找不到任何相关内容.

Couldn't find anything related on the API documentation.

所以使用带有本地源的基本自动完成示例

So using an basic autocomplete example with local source

$( "#find-subj" ).autocomplete({
    source: availableTags
});

当搜索匹配时,它会显示此相关帮助文本:

When the search matches it shows this related helper text:

'1 个结果可用,使用向上和向下箭头键导航.'

'1 result is available, use up and down arrow keys to navigate.'

如何以一种不错的方式禁用它,而不是使用 JQuery 选择器将其删除.

How can I disable it in a nice way, not by removing it with JQuery selectors.

推荐答案

我知道这已经被回答了,但只是想给出一个实现示例:

I know this has been asnwered but just wanted to give an implementation example:

var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++"
    ];

$("#find-subj").autocomplete({
    source: availableTags,
    messages: {
        noResults: 'no results',
        results: function(amount) {
            return amount + 'results.'
        }
    }
});

这篇关于如何删除/更改 JQuery UI 自动完成助手文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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