Foundation-making-closable

提供:Dev Guides
移動先:案内検索

財団-コールアウト閉鎖可能

説明

コールアウトは、要素に_data-closable_属性を使用して閉じることができます。これにより、却下可能なアラートボックスが作成されます。

次の例は、Foundationでの_closable callout_の使用を示しています-

<!doctype html>
   <head>
      <meta charset = "utf-8"/>
      <meta http-equiv = "x-ua-compatible" content = "ie = edge"/>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1.0"/>

      <title>Closable Callout</title>

      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.5/css/foundation.css">
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/motion-ui/1.1.1/motion-ui.css"/>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.5/js/vendor/jquery.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.5/js/foundation.min.js"></script>
   </head>

   <body>
      <h2>Closable Callout Example</h2>
      <div class = "alert callout" data-closable>
         <h5>This is Closable Callout</h5>
         <p>Foundation is a responsive front-end framework.</p>
         <button class = "close-button" data-close aria-label = "Dismiss alert">×</button>
      </div>
   </body>
</html>

出力

上記のコードがどのように機能するかを確認するために次の手順を実行してみましょう-

  • 上記のHTMLコード making_closablel ファイルを保存します。
  • このHTMLファイルをブラウザで開くと、次のように出力が表示されます。