- jQuery Mobile 教程
- jQuery Mobile - 主頁
- jQuery Mobile - 概述
- jQuery Mobile - 設定
- jQuery Mobile - 頁面
- jQuery Mobile - 圖示
- jQuery Mobile - 過渡
- jQuery Mobile - 佈局
- jQuery Mobile - 小元件
- jQuery Mobile - 事件
- jQuery Mobile - 表單
- jQuery Mobile - 主題
- jQuery Mobile - CSS 類
- jQuery Mobile - 資料屬性
- jQuery Mobile 有用資源
- jQuery Mobile - 面試問題
- jQuery Mobile - 快速指南
- jQuery Mobile - 有用資源
- jQuery Mobile - 討論
jQuery Mobile - 可摺疊集
描述
你可以應用一系列單獨的可摺疊內容,讓你可以同時開啟多行。可摺疊內容的邊框可以透過自定義 CSS 來定製。
示例
以下示例演示了在 jQuery Mobile 中使用可摺疊集。
<!DOCTYPE html>
<html>
<head>
<title>Collapsible Set</title>
<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>
<div data-role = "collapsible">
<h3>Audi</h3>
<ul data-role = "listview">
<li><a href = "#">Audi A4</a></li>
<li><a href = "#">Audi Q3</a></li>
<li><a href = "#">Audi R8</a></li>
</ul>
</div>
<div data-role = "collapsible">
<h3>Mahindra</h3>
<ul data-role = "listview">
<li><a href = "#">XUV 500</a></li>
<li><a href = "#">Scorpio</a></li>
<li><a href = "#">Xylo</a></li>
</ul>
</div>
<div data-role = "collapsible">
<h3>Hyundai</h3>
<ul data-role = "listview">
<li><a href = "#">Verna</a></li>
<li><a href = "#">i20</a></li>
<li><a href = "#">Elantra</a></li>
</ul>
</div>
</body>
</html>
輸出
讓我們執行以下步驟,看看上面的程式碼如何工作 -
將上面的 HTML 程式碼另存為collapsible_set.html檔案,並儲存在你的伺服器根資料夾。
開啟這個 HTML 檔案:https:///collapsible_set.html,將會顯示以下輸出。
jquery_mobile_widgets.htm
廣告