保持用户界面自动完成全天开放 [英] keep ui autocomplete open at all times

查看:163
本文介绍了保持用户界面自动完成全天开放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的用户界面自动完成:在这里

I'm using the ui autocomplete: over here

我需要自动完成功能是在任何时候都打开,让被点击在身体某处时,它不应该关闭。我用Google搜索,但我无法找到任何东西。

I need the autocomplete to be open at all times, so it shouldn't close when somewhere in the body is clicked. I have googled this but I couldn't find anything.

推荐答案

在这里有一个如何做到这一点的工作示例:的http://的jsfiddle。净/ 4pk3V /

here's a working example of how to do it : http://jsfiddle.net/4pk3V/

让您自动完成对话框打开再次搜索相同的输入时被触发关闭事件:

keep your autocomplete box open by searching the same input again whenever close event is triggered:

$( "#input" ).autocomplete({
    source: availableTags,

    close : function (event, ui) {
         val = $("#comment").val();
         $("#input").autocomplete( "search", val ); //keep autocomplete open by 
         //searching the same input again
         $("#input").focus();
        return false;  
    }
});

这篇关于保持用户界面自动完成全天开放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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