- jQuery 移動版教程
- jQuery 移動版 - 主頁
- jQuery 移動版 - 概述
- jQuery 移動版 - 設定
- jQuery 移動版 - 頁面
- jQuery 移動版 - 圖示
- jQuery 移動版 - 過渡
- jQuery 移動版 - 佈局
- jQuery 移動版 - 小部件
- jQuery 移動版 - 事件
- jQuery 移動版 - 表單
- jQuery 移動版 - 主題
- jQuery 移動版 - CSS 類
- jQuery Mobile 資料屬性
- jQuery 移動版有用資源
- jQuery 移動版 - 面試題
- jQuery 移動版 - 快速指南
- jQuery 移動版 - 有用資源
- jQuery 移動版 - 討論
jQuery 移動版 - 圖示左部選擇選單
描述
預設情況下,自定義選擇選單圖示設定在右側。使用 data-iconpos = "left" 屬性可以將自定義 selectmenu 圖示按鈕的位置設定為左側。
示例
以下示例演示了在 jQuery 移動版中使用 selectmenu 中的左圖示。
<!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>Selectmenu Icon Left Position Example</h2>
<div class = "ui-field-contain">
<label for = "select-custom">Custom Select</label>
<select id = "select-custom" data-native-menu = "false" data-iconpos = "left">
<option value = "mu">Mumbai</option>
<option value = "pu">Pune</option>
<option value = "be">Belgaum</option>
<option value = "ch">Chennai</option>
<option value = "ban">Bangalore</option>
</select>
</div>
</body>
</html>
輸出
讓我們執行以下步驟,瞭解上面的程式碼是如何執行的——
將上述 html 程式碼另存為 selectmenu_icon_left.html 檔案,並儲存到伺服器根資料夾中。
https:///selectmenu_icon_left.html 方式開啟此 HTML 檔案,將顯示以下輸出。
jquery_mobile_widgets.htm
廣告