附加一个环节到jQuery用户界面自动完成 [英] Append one link to jquery ui autocomplete

查看:104
本文介绍了附加一个环节到jQuery用户界面自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想达到的目标是,当autcompletion列表呈现,有一个链接一个额外的div追加到resultlist。不知何故这不是为我工作。我试过

what i want to achieve is, that when the autcompletion list is rendered, an additional div with one link is appended to the resultlist. somehow this is not working for me. i've tried

    $(".ui-autocomplete").append('<div style="border:1px solid red"><a href="#">Click me to get in contact</a></div>');

但不工作。如果我做

but that's not working. If i do

    $(".ui-autocomplete").append('<p>Ramo</p>');

然后我得到解决的自动完成box.That的优良ul元素红色边框,所以我想简单的追加应该工作。

then i get a red border around the ul element of the autocomplete box.That's fine, so i thought a simple append should work.

有关这个问题的任何想法?

Any ideas for that issue?

最好的问候,
拉莫

Best regards, Ramo

推荐答案

您可以做

  $( "#tags" ).autocomplete({
        source: availableTags,
        open: function(){
            $(".ui-autocomplete").append('<li style="border:1px solid red"><a href="#">Click me to get in contact</a></li>');
        }
    });

在这里捣鼓 http://jsfiddle.net/uuPGq/

这篇关于附加一个环节到jQuery用户界面自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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