回答
你只需要更新保存在您的列表項的文本.ui-li-desc
元素的CSS:
.ui-page .ui-content .ui-listview .ui-li-desc {
white-space : normal;
}
這裏是一個演示:http://jsfiddle.net/Xc6PJ/
一些好的文檔對於white-space
:https://developer.mozilla.org/en/CSS/white-space
這是一個示例li jQuery Mobile的之後,從我的測試listview
ST-項目已初始化它:
<li class="ui-li ui-li-static ui-body-c">
<h3 class="ui-li-heading">Sample Title</h3>
<p class="ui-li-desc">
Sample Content Sample Content Sample Content Sample Content Sample Content Sample Content Sample Content Sample Content Sample Content Sample Content Sample Content
</p>
</li>
謝謝!這解決了我的問題。 – 2014-10-07 17:27:45
我的建議是在<li>
中使用一個DIV並設置你想要的特定的行爲,而不是改變了jQuery移動的整體行爲CSS。有了這個,你可以只有特定的事情按照你想要的方式行事。
你可以做到這一點是純粹的CSS(不需要額外的元素)。您只需要將一個類(或其他類型的標識符)應用於list-element並在CSS selcetor中使用該類(或其他類)。 – Jasper 2014-02-26 20:57:16
在li
部分的內部添加div
與style="white-space:normal;"
部分強制自動換行。
完美,簡單,甜美的解決方案。 – 2015-12-09 09:51:45
在jQuery Mobile的1.4.4這個工作:
.ui-listview > li p {
white-space: normal;
}
- 1. UILabel Word Wrap/Character Wrap
- 2. iTextSharp word wrap
- 3. Netbeans 7.0.1 Word Wrap
- 4. Xcode 4.2 - UILabel Word Wrap
- 5. Java Swing g.drawString Word Wrap
- 6. IE 7 Word-wrap bug
- 7. URL Word-wrap問題
- 8. 如何在eclipse中添加Word Wrap(4.5.0)
- 9. Android Word-Wrap EditText文本
- 10. Excel Word Wrap在宏後出現錯誤
- 11. jQuery .wrap問題
- 12. Jquery Accordion Form Wrap
- 13. JQuery wrap()問題
- 14. 用android啓動手機gis
- 15. Sharepoint 2010不支持word-wrap屬性
- 16. 圖形DrawString與受控Word Wrap
- 17. 調整UILabel以適應Word Wrap
- 18. 爲Eclipse XQuery插件打開Word Wrap
- 19. 修復Gridview與Word Wrap的寬度列
- 20. 用jquery包裝Wrap元素?
- 21. 在手機上啓動ContentObserver啓動
- 22. 無法在手機啓動Android中
- 23. Visual Studio 2010中的Word Wrap快捷方式在哪裏?
- 24. Word-Wrap不能在引導流體容器中工作
- 25. jquery wrap div與div
- 26. 手機jquery onclick
- 27. jQuery手機:輸入不在jquery手機樣式
- 28. jQuery手機有延遲
- 29. 使用jQuery手機離線
- 30. 如何手動調用jQuery手機
你可以發佈你的代碼爲一個單獨的列表項? – Jasper 2012-03-16 19:59:25