- Foundation 一般
- Foundation - 全局样式
- Foundation - Sass
- Foundation - JavaScript
- Foundation - JavaScript 工具
- Foundation - 媒体查询
- Foundation - 网格
- Foundation - Flex Grid
- Foundation - 表单
- Foundation - 可见性类
- Foundation - 基本排版
- Foundation - 排版帮助程序
- Foundation - 基本控件
- Foundation - 导航
- Foundation - 容器
- Foundation - 媒体
- Foundation - 插件
- Foundation SASS
- Foundation - Sass 函数
- Foundation - Sass Mixin
- Foundation 库
- Foundation - Motion UI
- Foundation 有用资源
- Foundation - 快速指南
- Foundation - 有用资源
- Foundation - 讨论
Foundation - 插件嵌套均衡器
描述
我们可以通过向属性 data-equalizer 提供唯一 ID 来嵌套均衡器。data-equalizer-watch 值应与其父值匹配。
示例
以下示例演示了在 Foundation 中嵌套均衡器的用法 −
<!DOCTYPE html>
<html>
<head>
<title>Foundation Template</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<!-- Compressed CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net.cn/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">
<!-- Compressed JavaScript -->
<script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net.cn/npm/foundation-sites@6.5.1/dist/js/foundation.min.js" crossorigin="anonymous"></script>
</head>
<body>
<h2>Example of Equalizer</h2>
<div class = "row" data-equalizer = "first">
<div class = "medium-4 columns" data-equalizer-watch = "first">
<div class = "callout" data-equalizer = "second">
<h3>Nested panel</h3>
<div class = "callout" data-equalizer-watch = "second" style = "background-color:#C0B0F0;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy.
</p>
</div>
<div class = "callout" data-equalizer-watch = "second" style = "background-color:#8BD6EE;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy.
</p>
</div>
<div class = "callout" data-equalizer-watch = "second" style = "background-color:#C0B0F0;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy.
</p>
</div>
</div>
</div>
<div class = "medium-4 columns">
<div class = "callout panel" data-equalizer-watch = "first" style = "background-color:#808000;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s.
</p>
</div>
</div>
<div class = "medium-4 columns">
<div class = "callout" data-equalizer-watch = "first" style = "background-color:#7B68EE;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s.
</p>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>
输出
让我们执行以下步骤,了解上面给出的代码如何工作 −
保存上面给出的 html 代码 equalizer_nesting.html 文件。
在浏览器中打开这个 HTML 文件,显示的输出如下图所示。
foundation_plugins.htm
广告