2013-02-26 18 views
5

Làm cách nào để bắt đầu hiển thị tiêu đề và văn bản bên dưới tràn vào dấu ba chấm? Tôi không thể làm cho nó hoạt động với mục danh sách BlackBerry khi trang rộng hơn 768px.Lỗi tràn trên thiết bị di động jQuery của li-desc

http://jsfiddle.net/TeNXG/14/

<div data-role="page" data-theme="a" id="demo-page" class="my-page" data-url="demo-page"> 
<div data-role="header"> 
    <h1>News</h1> 
    <a href="grid-listview.html" data-shadow="false" data-iconshadow="false" data-icon="arrow-l" data-iconpos="notext" data-rel="back" data-ajax="false">Back</a> 
</div><!-- /header --> 
<div data-role="content"> 
    <ul data-role="listview"> 
     <li><a href="#"> 
      <img src="http://view.jquerymobile.com/master/docs/_assets/img/apple.png"> 
      <h2>iOS 6.1</h2> 
      <p>Apple released iOS 6.1</p> 
      <p class="ui-li-aside">iOS</p> 
     </a></li> 
     <li><a href="#"> 
      <img src="http://view.jquerymobile.com/master/docs/_assets/img/blackberry_10.png"> 
      <h2>BlackBerry 10</h2> 
      <p>BlackBerry launched the Z10 and Q10 with the new BB10 OS and more and stuff and lots of stuff and overflowing and stuff and wow so much text man holy mess even more let's see just how jacked we can make this div</p> 
      <p class="ui-li-aside">BlackBerry</p> 
     </a></li> 
    </ul> 
</div><!-- /content --> 
<div data-role="footer" data-theme="none"> 
    <h3>Responsive Grid Listview</h3> 
</div><!-- /footer --> 

+0

Bạn có nghĩa là tràn văn bản vào dấu ba chấm hay không? bởi vì trên jsfiddle chảy vào dấu ba chấm. sửa tôi nếu tôi sai. – Omar

+0

Văn bản tràn vào dấu ba chấm trên phiên bản nhỏ hơn, nhưng khi bạn kéo nó đến 768px, nó không còn nữa. – Iammesol

Trả lời

3

Thêm white-space: nowrap; vào khối mô tả:

ui-listview .ui-li-desc { 
    white-space: nowrap; 
    overflow: visible; 
    position: absolute; 
    left: 0; 
    right: 0; 
} 

Xem các cập nhật jsFiddle.

+0

Cảm ơn! Có cách nào có thể để có nó đi một vài dòng xuống trước khi được dấu ba chấm? Tôi đoán chỉ định chiều cao? – Iammesol

+1

Tôi không nghĩ rằng bạn không thể ở trong css một mình. (trắng-không gian: nowrap có nghĩa là KHÔNG VIẾT!): P – gtgaxiola

+0

Điều đó giải thích nó. Cảm ơn các bạn! – Iammesol