jQuery Mobile - 無內嵌可摺疊



說明

若要移除內嵌外觀並顯示可摺疊的完全寬度而沒有拐角樣式,則可新增data-inset = "false" 屬性。

示例

以下示例展示了在 jQuery Mobile 中使用無內嵌可摺疊

<!DOCTYPE html>
<html>
   <head>
      <title>Non-inset Collapsible</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>
      <div data-role = "collapsible" data-inset = "false">
         <h3>Heading</h3>
         <p>Hi!! Have a nice day!!</p>
      </div>
   </body>
</html>

輸出

執行以下步驟來了解上述程式碼的執行方式 -

  • 將以上 html 程式碼另存為collapsible_non_inset.html 檔案,並儲存在伺服器根目錄中。

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

jquery_mobile_widgets.htm
廣告
© . All rights reserved.