jQuery Mobile - 列表檢視內嵌



描述

透過包含屬性data-inset = "true"來應用內嵌外觀。這有助於在一個頁面上混合列表檢視和其他內容。

示例

以下示例演示了在 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 Inset Example</h2>
      <ul data-role = "listview" data-inset = "true">
         <li><a href = "">Chennai</a></li>
         <li><a href = "">Bangalore</a></li>
         <li><a href = "">Pune</a></li>
         <li><a href = "">Mumbai</a></li>
         <li><a href = "">Delhi</a></li>
      </ul>
   </body>
</html>

輸出

讓我們執行以下步驟,看看上面的程式碼如何工作 -

  • 將上述 html 程式碼另存為伺服器根資料夾中的listview_inset.html檔案。

  • 開啟此 HTML 檔案為 https:///listview_inset.html,然後將顯示以下輸出。

jquery_mobile_widgets.htm
廣告
© . All rights reserved.