jQuery Mobile - 隱藏滑塊標籤



說明

可透過將ui-hidden-accessible類新增到<label>來隱藏滑塊標籤。

示例

以下示例演示了在 jQuery Mobile 中使用隱藏滑塊標籤

<!DOCTYPE html>
<html>
   <head>
      <title>Slider Label Hidden</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" class = "ui-hidden-accessible">Slider:</label>
         <input type = "range" name = "slider1" id = "slider1" min = "0" max = "100" 
            value = "60">
      </form>
      
   </body>
</html>

輸出

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

  • 將以上 html 程式碼另存為slider_label_hidden.html檔案,並儲存在伺服器根資料夾中。

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

jquery_mobile_widgets.htm
廣告
© . All rights reserved.