【发布时间】:2017-04-26 21:16:15
【问题描述】:
我正在尝试初始化基础工具提示而不初始化所有内容(即$(document).foundation()),但我在这个简单的任务中失败了。
我想知道 (1) 如何改用 new Foundation.Tooltip (2) 我是否需要 modernizr 因为 documentation in foundation website 没有提到modernizr 作为要求。
我提到了modernizr,因为如果没有那个工具提示,里面就没有任何样式或 html 会显示。
谢谢
<!DOCTYPE html>
<meta name="robots" content="noindex">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script> -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.1/js/foundation.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.1/css/foundation.css" />
<body>
<div class="row">
<span class="has-tip" title="Tooltips are awesome, you <a>link</a> totally use them!">
Hover me
</span>
</div>
<script id="jsbin-javascript">
$(document).ready(function() {
new Foundation.Tooltip($(".has-tip"), {
allowHtml: true
});
// $(document).foundation();
})
</script>
</body>
</html>
【问题讨论】:
-
还有什么需要回答的,我可以添加到我的回复中吗?
标签: javascript jquery html zurb-foundation