我想使用tocify jquery script。在这个简单的页面中,它在 Firefox 38.0.1 中无法正常工作。
它应该在#toc div 中显示一个小目录。从正文中的扫描标签生成。但是如果我在 Firefox 中渲染这个页面,什么都不会发生。它只显示 'hello' 和 'hello2' 而没有 tocify 应该生成的目录。
我在这个 html 代码中做错了吗?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
<!-- Tocify - nice dynamic autoscrolling TOC -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/stylesheets/jquery.tocify.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var toc = $("#toc").tocify({
scrollTo : 50,
extendPage : true,
selectors : "h1,h2,h3,h4,h5",
showEffect : "fadeIn"
});
});
</script>
</head>
<body>
<div id="toc" ></div>
<h2 id="hello">Hello</h2>
<h2 id="hello2">Hello2</h2>
</body>
</html>