- jQuery 移動教程
- jQuery 移動 - 主頁
- jQuery 移動 - 概述
- jQuery 移動 - 設定
- jQuery 移動 - 頁面
- jQuery 移動 - 圖示
- jQuery 移動 - 過渡
- jQuery 移動 - 佈局
- jQuery 移動 - 小元件
- jQuery 移動 - 事件
- jQuery 移動 - 表單
- jQuery 移動 - 主題
- jQuery 移動 - CSS 類
- jQuery 移動 - 資料屬性
- jQuery 移動實用資源
- jQuery 移動 - 面試問題
- jQuery 移動 - 快速入門
- jQuery 移動 - 實用資源
- jQuery 移動 - 討論
可摺疊設定圖示定位
說明
若要覆蓋預設圖示位置,請在collapsibleset 級別或在其所屬的任何可摺疊項上使用 data-iconpos 屬性。
範例
以下範例演示如何在 jQuery 移動中使用摺疊設定圖示。
<!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-iconpos = "right">
<div data-role = "collapsible">
<h3>Right</h3>
<p>Hi!! This is collapsible content</p>
</div>
<div data-role = "collapsible" data-iconpos = "left">
<h3>Left</h3>
<p>Hi!! This is collapsible content</p>
</div>
<div data-role = "collapsible" data-iconpos = "bottom">
<h3>Bottom</h3>
<p>Hi!! This is collapsible content</p>
</div>
<div data-role = "collapsible" data-iconpos = "top">
<h3>Top</h3>
<p>Hi!! This is collapsible content</p>
</div>
</div>
</body>
</html>
輸出
讓我們執行以下步驟以瞭解以上程式碼的工作原理 −
將以上 html 程式碼另存為伺服器根資料夾中的collapsible_set_icon_positioning.html 檔案。
開啟此 HTML 檔案,例如 https:///collapsible_set_icon_positioning.html,將顯示以下內容。
jquery_mobile_widgets.htm
廣告