我错过了什么吗?我打电话了吗?插件来自http://www.berriart.com/sidr/ 它也为我生成了一个普通的页面。我确信CSS路径是正确的。
<!DOCTYPE HTML>
<head>
<!-- Your stuff -->
<!-- Include Sidr bundled CSS theme -->
<link rel="stylesheet" href="stylesheets/jquery.sidr.dark.css">
</head>
<body>
<a id="simple-menu" href="#sidr">Toggle menu</a>
<div id="sidr">
<!-- Your content -->
<ul>
<li><a href="#">List 1</a></li>
<li class="active"><a href="#">List 2</a></li>
<li><a href="#">List 3</a></li>
</ul>
</div> <script>
$(document).ready(function() {
$('#simple-menu').sidr();
});
</script>
<a href="http://www.boysgeneration.net/sidebar/#simple-menu"> Activate here</a>
<!-- Include jQuery -->
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<!-- Include the Sidr JS -->
<script src="jquery.sidr.min.js"></script>
</body>
</html>
答案 0 :(得分:3)
在代码
之前调用jqueries文件<!-- Include jQuery -->
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<!-- Include the Sidr JS -->
<script src="jquery.sidr.min.js"></script>
$(document).ready(function() {
$('#simple-menu').sidr();
});
并试试这个
$(document).ready(function() {
$('#simple-menu').sidr({name:'sidr'});
});