jQuery Mobile - 微型滑動條 Fieldcontain



說明

可以將 ui-field-contain 類新增到微型滑塊元素,以便響應式呈現。

示例

以下示例演示如何在 jQuery Mobile 中使用微型滑動條 fieldcontain

<!DOCTYPE html>
<html>
   <head>
      <title>Fieldcontain, mini sized</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>
   
      <form>
         <div class = "ui-field-contain">
            <label for = "slider1">Slider:</label>
            <input type = "range" name = "slider1" id = "slider1" data-mini = "true" 
               min = "0" max = "100" value = "60">
         </div>
      </form>
      
   </body>
</html>

輸出

請執行以下步驟,瞭解上述程式碼的工作原理:

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

  • 開啟該 HTML 檔案(如 https:///slider_fieldcontain_mini.html),將顯示以下輸出。

jquery_mobile_widgets.htm
廣告
© . All rights reserved.