gpt4 book ai didi

javascript - 下拉列表问题 ZURB 基金会

转载 作者:行者123 更新时间:2023-11-28 16:56:43 28 4
gpt4 key购买 nike

点击按钮并没有像我认为的那样创建一个下拉列表。有谁知道我在这里做错了什么或者为什么它可能不起作用?

<!doctype html>
<html class="no-js" lang="en">
<meta charset="" />
<meta name="viewport" content="width=device-width, initial-scaler=1.0" />
<script src="js/foundation/foundation.dropdown.js"></script>
<script src="js/foundation/foundation.js"></script>
<link rel="stylesheet" href="css/foundation.css" />
<body>
<div class="row">
<div class="column">
<a href="#" class="button dropdown" data-dropdown="drop1">dropdown</a>
</div>
</div>
<ul class="f-dropdown" data-dropdown-content id="drop1">
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>


<script>
$(document).foundation();
</script>
</body>
</html>

最佳答案

您没有加载 jquery,另外,您的 css/js 文件有问题,仔细检查您的路径

    <!doctype html>
<head>
<html class="no-js" lang="en">
<meta charset="" />
<meta name="viewport" content="width=device-width, initial-scaler=1.0" />

<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.css" rel="stylesheet"/>
</head>
<body>
<div class="row">
<div class="column">
<a href="#" class="button" data-dropdown="drop">Link Dropdown &raquo;</a>
<ul id="drop" class="tiny f-dropdown" data-dropdown-content>
<li><a href="#">This is a link</a></li>
<li><a href="#">This is another</a></li>
<li><a href="#">Yet another</a></li>
</ul>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/foundation.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>

关于javascript - 下拉列表问题 ZURB 基金会,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31995076/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com