- Foundation 教程
- Foundation - 主頁
- Foundation - 概述
- Foundation - 安裝
- Foundation - Starter 專案
- Foundation - 大雜燴
- Foundation 概覽
- Foundation - 全域性樣式
- Foundation - Sass
- Foundation - JavaScript
- Foundation - JavaScript 實用工具
- Foundation - 媒體查詢
- Foundation - 網格
- Foundation - 靈活網格
- Foundation - 表單
- Foundation - 可見性類
- Foundation - 基本排版
- Foundation - 排版助手
- Foundation - 基本控制元件
- Foundation - 導航
- Foundation - 容器
- Foundation - 媒體
- Foundation - 外掛
- Foundation SASS
- Foundation - Sass 函式
- Foundation - Sass 混合
- Foundation 庫
- Foundation - Motion UI
- Foundation 實用資源
- Foundation - 快速指南
- Foundation - 實用資源
- Foundation - 討論
Foundation - 可關閉彈出框
說明
可以使用data-closable屬性將元素關閉,從而建立可以關閉的警報框。
範例
以下示例演示在 Foundation 中使用可關閉彈出框 −
<!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_closable.html 檔案。
在瀏覽器中開啟此 HTML 檔案,輸出如下所示。
foundation_containers.htm
廣告