動撲手風琴設定圖示
描述
為了覆蓋預設標題圖示,請在可摺疊data-collapsed-icon和data-expanded-iconleset 級別或在其任意一個可摺疊專案上新增屬性。
示例
以下示例演示了動撲中可摺疊設定圖示的使用。
<!DOCTYPE html>
<html>
<head>
<title>Collapsible set icon</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 = "collapsibleset" data-theme = "a" data-content-theme = "a"
data-collapsed-icon = "carat-d" data-expanded-icon = "carat-u">
<div data-role = "collapsible">
<h3>Heading</h3>
<p>Hi!! This is collapsible content</p>
</div>
<div data-role = "collapsible">
<h3>Heading</h3>
<p>Hi!! This is collapsible content</p>
</div>
<div data-role = "collapsible" data-collapsed-icon = "plus" data-expanded-icon = "minus">
<h3>Heading</h3>
<p>Hi!! This is collapsible content</p>
</div>
</div>
</body>
</html>
輸出
讓我們執行以下步驟以瞭解上述程式碼如何工作 −
將上述 HTML 程式碼儲存為伺服器根資料夾中的collapsible_set_icon.html檔案。
開啟此 HTML 檔案為 https:///collapsible_set_icon.html,接著將顯示以下輸出。
jquery_mobile_widgets.htm
廣告