Jquery-mobile-listview-formatted-content

提供:Dev Guides
移動先:案内検索

jQuery Mobile-リストビュー形式のコンテンツ

説明

見出しと段落タグを使用して、適切な階層形式でコンテンツを追加します。 クラス ui-li-aside を含めて、リスト項目の右側に補足情報を追加します。

次の例は、jQuery Mobileのリストでのサムネイルの使用を示しています。

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
   </head>

   <body>
      <h2>Listview Formatted Content Example</h2>
      <ul data-role = "listview" data-inset = "true">
         <li data-role = "list-divider">Wednesday, January 13, 2016
            <span class = "ui-li-count">2</span></li>

         <li><a href = "#">
            <h2>John</h2>
            <p><strong>Team Meeting</strong></p>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p></a>
            <p class = "ui-li-aside"><strong>12:48</strong>PM</p>
         </li>

         <li><a href = "#">
            <h2>Albert</h2>
            <p><strong>Updation of work</strong></p>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p></a>
            <p class = "ui-li-aside"><strong>4:01</strong>PM</p>
         </li>

         <li data-role = "list-divider">Thursday, January 14, 2016
            <span class = "ui-li-count">2</span></li>

         <li><a href = "#"><h2>Joy</h2>
            <p><strong>New Project Information</strong></p>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p></a>
            <p class = "ui-li-aside"><strong>09:25</strong>PM</p>
         </li>
      </ul>
   </body>
</html>

出力

上記のコードがどのように機能するかを確認するために、次の手順を実行してみましょう-

  • 上記のHTMLコードを listview_formatted_contentl ファイルとしてサーバーのルートフォルダーに保存します。
  • このHTMLファイルをhttp://localhost/listview_formatted_contentlとして開くと、次の出力が表示されます。