如何使用 Bootstrap Collapse 外掛


Collapse 外掛可以輕鬆使頁面部門摺疊。無論是構建手風琴導航欄或內容框,它均支援許多內容選項。

您可以嘗試執行以下程式碼,在 Bootstrap 中實現 Collapse 外掛 -

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "panel-group" id = "accordion">
         <div class = "panel panel-default">
            <div class = "panel-heading">
               <h4 class = "panel-title">
                  <a data-toggle = "collapse" data-parent = "#accordion" href = "#collapseOne">
                     Click me to expand. Click me again to collapse.Section
                  </a>
               </h4>
            </div>
            <div id = "collapseOne" class = "panel-collapse collapse in">
               <div class = "panel-body">
                  Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred
                  nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo.
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

更新於:15-Jun-2020

94 瀏覽量

開啟您的職業生涯

透過完成課程獲得認證

開始使用
廣告
© . All rights reserved.