- 基礎通用
- 基礎 - 全域性樣式
- 基礎 - Sass
- 基礎 - JavaScript
- 基礎 - JavaScript 實用工具
- 基礎 - 媒體查詢
- 基礎 - 網格
- 基礎 - flex 網格
- 基礎 - 表單
- 基礎 - 可見性類
- 基礎 - 基本排版
- 基礎 - 排版輔助
- 基礎 - 基本控制元件
- 基礎 - 導航
- 基礎 - 容器
- 基礎 - 媒體
- 基礎 - 外掛
- 基礎 SASS
- 基礎 - Sass 函式
- 基礎 - Sass 混合
- 基礎庫
- 基礎 - 運動UI
基礎 - 外掛貼上高階
描述
data-top-anchor = "idOfSomething", data-btm-anchor = "idOfSomething:[top/bottom]",或使用設定畫素數 data-top-anchor = "150" 可將影像或黏貼內容設為特定高度。
示例
以下示例演示了在基礎中使用切換器外掛 -
<!doctype html>
<head>
<meta name = "viewport" content = "width = device-width, initial-scale = 1.0" />
<title>Reveal Animations</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/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/npm/foundation-sites@6.5.1/dist/js/foundation.min.js" crossorigin="anonymous"></script>
<link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/motion-ui/1.1.1/motion-ui.css">
</head>
<body>
<h2>Advanced Sticky</h2>
<div class = "columns small-6" id = "advanced">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p id = "foo">Lorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
<div class = "columns small-6 right sticky-container" data-sticky-container>
<div class = "sticky" data-sticky data-top-anchor = "advanced:top" data-btm-anchor = "foo:bottom">
<img class = "thumbnail" src = "/foundation/images/foundation-plugin/small.jpg">
</div>
</div>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>
輸出
讓我們執行以下步驟來了解以上程式碼如何運作 -
將上述 html 程式碼儲存為sticky_advanced.html 檔案。
在瀏覽器中開啟此 HTML 檔案,輸出如下所示。
foundation_plugins.htm
廣告