jQuery Mobile - 停用滑塊



描述

你可以使用 disabled 屬性來停用滑塊。

示例

以下示例演示了在 jQuery Mobile 中使用 slider disable 的方法。

<!DOCTYPE html>
<html>
   <head>
      <title>Slider Disabled</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" disabled = "disabled" 
            min = "0" max = "100" value = "60">
      </form>
      
   </body>
</html>

輸出

讓我們執行以下步驟瞭解以上程式碼如何工作的 −

  • 將以上 html 程式碼作為slider_disabled.html檔案儲存在你的伺服器根目錄中。

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

jquery_mobile_widgets.htm
廣告
© . All rights reserved.