0
我正在爲本地軟件開發用戶組進行演示。我正在嘗試構建一個JQuery Mobile應用程序,該應用程序將允許我們爲下次會議投票選擇不同的食物選項。這些選項將被動態加載。因此,我必須動態構建列表。我有實際的投票功能工作。我的問題是,我無法讓佈局看起來正確。現在,但按鈕看起來像JQuery Mobile - 佈局未正確對齊
正如你所看到的,沒有任何東西是正確對齊的。我已經嘗試了各種CSS更改,沒有任何運氣。我覺得有什麼我不知道的。我認爲這將是相當直接的。但到目前爲止,我錯了。這是我的相關JavaScript:
$("#votesList").empty();
$.each(votesCollection, function (i, item) {
var s = "<li><div class='ui-grid-a'><div class='ui-block-a'>";
s += "<label><strong>" + item.data.name + "</strong></label><br />";
s += "<span style='font-weight:normal;'>" + item.data.description + "</span>";
s += "</div>";
var v = getTotalVotes(i);
s += "<div class='ui-block-b ui-grid-b'>";
s += "<div class='ui-block-a'><input id='decButton" + i + "' type='button' value=' - ' data-mini='true' onclick='decrementVotes(" + i + ", \"" + item.data.name + "\");' /></div>";
s += "<div class='ui-block-b'> <input id='voteText" + i + "' type='text' data-mini='true' value='" + v + "' style='text-align:center;' /> </div>";
s += "<div class='ui-block-c'><input id='incButton" + i + "' type='button' data-mini='true' value=' + ' onclick='incrementVotes(" + i + ", \"" + ps.data.name + "\");' /></div>";
s += "</div></div></li>";
$("#votesList").append(s);
});
$("#votesList").listview("refresh");
for (var x = 0; x < votesCollection.length; x++) {
$("#decButton" + x).button();
$("#voteText" + x).textinput();
$("#incButton" + x).button();
}
有人可以幫我嗎?
嘗試刪除'' 哇 – mkk 2012-04-07 12:32:03
!我認爲它非常簡單。謝謝! – 2012-04-07 18:56:54