首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

jQuery UI autocomplete on focus

Posted on 2013-04-18 15:49  达奇  阅读(360)  评论(0编辑  收藏  举报

$('selector').autocomplete
        ({
        minLength: 0,
        source: function (t, r)
            {
            // get list here
            }
        })
    .focus
        (
        function()
            {
            if (this.value == "")
                {
                $(this).autocomplete('search', '');
                }
            }
        );

 

感谢:http://www.sikosoft.com/item/activate_jquery_autocomplete_on_focus