[英]jQuery-UI selectable into input
please follow this link: FIDDLE 请点击以下链接: FIDDLE
I'm building this input (that is a search tool) and I'm putting some "tips" to select. 我正在构建此输入(这是一个搜索工具),并添加了一些“提示”以供选择。
I use an hidden paragraph to store it better. 我使用一个隐藏的段落来更好地存储它。
I have 2 problems: 我有2个问题:
Thank you in advance for your help. 预先感谢您的帮助。
for your first question, try this code 对于第一个问题,请尝试以下代码
$(document).ready(function() {
var lista = $('ul#common-list');
lista.bind("mousedown", function (e) {
e.metaKey = true;
}).selectable({
stop: function () {
var result = $("input#search");
var fakeText = $('p.hidden-tips-text').empty();
$(".ui-selected", this).each(function () {
var index = $(this).text();
fakeText.append((index) + " ");
});
result.val(fakeText.text());
}
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.