Jquery-mobile-listview-count-bubbles

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

jQuery Mobile-リストビューカウントバブル

説明

*_ui-li-count_* class in要素は、右側のリストアイテムにカウントインジケーターを含めるのに役立ちます。 *_data-count-theme_* 属性を追加して、リスト内のカウントバブルのテーマを設定します。

次の例は、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>Count Bubble List Example</h2>
      <ul data-role = "listview" data-count-theme = "b" data-inset = "true">
         <li><a href = "#">Inbox<span class = "ui-li-count">100</span></a></li>
         <li><a href = "#">Starred<span class = "ui-li-count">5</span></a></li>
         <li><a href = "#">Important<span class = "ui-li-count">2</span></a></li>
         <li><a href = "#">Chats<span class = "ui-li-count">6</span></a></li>
         <li><a href = "#">Sent Mail<span class = "ui-li-count">20</span></a></li>
         <li><a href = "#">Drafts<span class = "ui-li-count">12</span></a></li>
      </ul>
   </body>
</html>

出力

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

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