我想初始化基礎工具提示而沒有初始化所有東西(即$(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>
有一些仍然有待回答,我可以添加到我的反應? – SupposedlySam