jQuery Mobile - 滑塊主題



描述

要設定滑塊的主題樣本,可在 input 中新增 data-theme 屬性。

示例

以下示例演示了在 jQuery Mobile 中使用 滑塊主題

<!DOCTYPE html>
<html>
   <head>
      <title>Slider Theme</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>
         <label for = "slider1">Slider:</label>
         <input type = "range" name = "slider1" id = "slider1" data-track-theme = "b" 
            data-theme = "b" min = "0" max = "100" value = "60">
      </form>
      
   </body>
</html>

輸出

讓我們執行以下步驟,瞭解上述程式碼如何工作:-

  • 將上述 HTML 程式碼另存為 slider_theme.html 檔案,並將其放在伺服器的根目錄中。

  • 將此 HTML 檔案開啟為 https:///slider_theme.html,將顯示以下輸出。

jquery_mobile_widgets.htm
廣告
© . All rights reserved.