【发布时间】:2014-08-11 02:41:01
【问题描述】:
我正在使用 facebook 之类的令牌输入,我想根据我的文本框更改其宽度。
$("input#receiver_id").tokenInput("add", {id : jsonData.id, first_name: jsonData.firstname, last_name: jsonData.lastname});
//Token input---------------
$("#receiver_id").tokenInput(PROJECT_URL+PROJECT_NAME+"mail/get-my-matching-contacts", {
onAdd: function (item) {
$("div#receiver_ids_holder").append("<input type = 'hidden' name = 'receiver_ids[]' class = 'receiver_ids' id = '"+item.id+"' value = '"+item.id+"'>");
$("#jq_receiver_id").attr('placeholder','');
},
onDelete: function (item) {
$('div#receiver_ids_holder input#'+item.id).remove();
},
theme: "facebook",
propertyToSearch: "first_name",
propertyToSearch: "last_name",
resultsFormatter: function(item){ return "<li><div style = 'width:25px; height:25px; display:inline-block;margin:0 0 4px 0;'><div style = 'width:25px; height:25px; display : table-cell; vertical-align: middle; text-align: center;'>" + "<img style = 'max-width : 25px; max-height : 25px;' src='" + item.url + "' title='" + item.first_name + " " + item.last_name + "'/></div></div>" + "<div style='display: inline-block; padding-left: 10px;'><div class='full_name'>" + item.first_name + " " + item.last_name + "</div><div class='email'>" + item.email + "</div></div></li>" },
tokenFormatter: function(item) { return "<li><p>" + item.first_name + " " + item.last_name + "</p></li>" },
});
我试图在它的 css 中给出宽度,但没有奏效。 在这方面需要一些即时帮助。
【问题讨论】:
-
你用 CSS 给宽度做了什么尝试。你能发布那段代码吗?
-
@chris div.token-input-dropdown-facebook ul li.token-input-selected-dropdown-item-facebook{ 宽度:100%; }