jQuery mobile:在ListView中启用Word Wrap [英] jQuery mobile: Enable Word Wrap in ListViews
本文介绍了jQuery mobile:在ListView中启用Word Wrap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个listview(见下面的照片),我想包装所有的内容,而不是添加...长行。
I have a listview (see photo below) that I would like to word wrap all the contents instead of adding ... to the long lines.
如何this done?
How is this done?
推荐答案
您只需要更新 .ui-li-desc
元素,其中包含您的列表项中的文本:
You just need to update the CSS for the .ui-li-desc
element that holds the text in your list-item:
.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
下面是jQuery Mobile初始化后的测试 listview
p>
Here is a sample list-item from my test listview
after jQuery Mobile has initialized it:
<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>
这篇关于jQuery mobile:在ListView中启用Word Wrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文