Dropdown Menu
优质
小牛编辑
129浏览
2023-12-01
描述 (Description)
下拉菜单用于以列表格式显示链接。
例子 (Example)
以下示例演示了在Foundation中使用dropdown menu -
<!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>Dropdown Pane</title>
<link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
<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>
</head>
<body>
<h2>Dropdown Menu Example</h2>
<ul class = "dropdown menu" data-dropdown-menu>
<li>
<a>Cars</a>
<ul class = "menu">
<li><a href = "#">Ford</a></li>
<li>
<a href = '#'>Mahindra</a>
<ul class = 'menu'>
<li><a href = '#'>Xylo</a></li>
<li><a href = '#'>Scorpio</a></li>
<li>
<a href = '#'>XUV</a>
<ul class = 'menu'>
<li><a href = '#'>W4</a></li>
<li><a href = '#'>W6</a></li>
</ul>
</li>
</ul>
</li>
<li><a href = "#">Skoda</a></li>
</ul>
</li>
<li>
<a href = "#">Sports</a>
<ul class = "menu">
<li><a href = "#">Cricket</a></li>
<li><a href = "#">Football</a></li>
</ul>
</li>
<li><a href = "#">Country</a></li>
</ul>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>