- 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
广告