- Foundation 通用
- Foundation - 全域性樣式
- Foundation - Sass
- Foundation - JavaScript
- Foundation - JavaScript 實用工具
- Foundation - 媒體查詢
- Foundation - 網格
- Foundation - Flex 網格
- Foundation - 表單
- Foundation - 可視性類
- Foundation - 基本印刷術
- Foundation - 印刷助手
- Foundation - 基本控制元件
- Foundation - 導航
- Foundation - 容器
- Foundation - 媒體
- Foundation - 外掛
- Foundation SASS
- Foundation - Sass 函式
- Foundation - Sass 混合
- Foundation 庫
- Foundation - 運動 UI
- Foundation 有用資源
- Foundation - 快速指南
- Foundation - 有用資源
- Foundation - 討論
Foundation - 分割按鈕
說明
要建立分割按鈕,必須新增 .arrow-only 類並建立兩個按鈕的按鈕組。您必須使用 .show-for-sr 對螢幕閱讀器使用標籤。
示例
以下示例演示瞭如何在 Foundation 中使用 分割按鈕。
<html>
<head>
<title>Split Buttons</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">
<link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css">
</head>
<body>
<div class = "button-group">
<a class = "button">Shut Down</a>
<a class = "dropdown button arrow-only"><span class = "show-for-sr">Show options</span></a>
</div>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>
輸出
讓我們執行以下步驟以瞭解上述給定程式碼如何工作的 -
儲存上面給定的 html 程式碼 button_split.html 檔案。
在瀏覽器中開啟此 HTML 檔案,將會顯示如下所示的輸出。
foundation_basic_controls.htm
廣告