我的JS腳本允許我輸出順序的用戶輸入在下面(計數器迭代和\噸間距)的順序爲:outputing數據
1. ab 2. bc 3. cd
4. de 5. ef 6. fg
7. gh 8. hi 9. ij
10. jk 11. ys
用戶僅給出1輸入字段中輸入1個條目一次。 11是不是最後一項,因爲他們可以繼續他們的工作輸入更多。 如何顯示?
1. ab 5. ef 9. ij
2. bc 6. fg 10. jk
3. cd 7. gh 11. ys
4. de 8. hi
我的腳本:
dnm_data.list_count += 1;
var data_output = "<b>" + dnm_data.list_count + ".</b> " + data;
if (dnm_data.list_count % 3 === 0)
data_output = "<div class='col-xs-4'>" + data_output + "</div><div class='clearfix'></div>";
else
data_output = "<div class='col-xs-4'>" + data_output + "</div>";
$("#log-wrapper") .append(data_output)
.addClass("bg-success")
歡迎SO。 請閱讀[我可以問哪些主題](http://stackoverflow.com/help/on-topic) 和[如何提出一個好問題](http://stackoverflow.com/help/how-to - 問) 和[完美的問題](http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) – RiggsFolly
你可以垂直輸出他們在一個div而不是跨越,和然後關閉它並在適當的時候在它旁邊打開一個新的? –