导航要跟着鼠标向下滚动,用了jquery插件但是报错,请问大牛是什么原因?
代码如下:
<!DOCTYPE html>
<html>
<head>
<title>宝龙安信科技</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Acrostia Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript" src="js/addEventListener.js"></script>
<!--fonts-->
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900' rel='stylesheet' type='text/css'>
<!--//fonts-->
<script type="text/javascript" src="js/responsiveslides.min.js"></script>
<script type="text/jscript" src="js/fonts.js"></script>
<!---->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript" src="js/top.js"></script>
<script type="text/javascript" src="js/menu-toggle.js"></script>
<script type="text/javascript" src="js/nav.js"></script>
<script type="text/javascript" src="js/UItotop.js"></script>
<script type="text/javascript" src="js/sticky-nav.js"></script>
</head>
<body>
<!--header-->
<!--banner-->
<div class="banner" id="home">
<div class="slider" >
<div class="callbacks_container">
<ul class="rslides" id="slider">
<li>
<img src="images/banner.jpg" alt="">
<div class="banner-matter">
<img class="img-responsive" src="images/good.png" alt=" " />
</div>
</li>
<li>
<img src="images/banner1.jpg" alt="">
<div class="banner-matter">
<img class="img-responsive" src="images/good.png" alt=" " />
</div>
</li>
<li>
<img src="images/banner2.jpg" alt="">
<div class="banner-matter">
<img class="img-responsive" src="images/good.png" alt=" " />
</div>
</li>
</ul>
</div>
</div>
</div>
<!---->
<div class="header" >
<div class="container">
<div class="fixed-header">
<div class="logo">
logo宝龙安信
</div>
<div class="top-nav cssmenu">
<nav class="nav clearfix">
<a id="menu-toggle" class="anchor-link"><img src="images/menu.png" alt="" /></a>
<ul class="simple-toggle" id="nav">
<li class="current"><a href="#home" class="scroll">主页</a></li>
<li ><a href="#services" class="scroll">产品介绍</a></li>
<li><a href="#contact" class="scroll">联系我们</a></li>
</ul>
</nav>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
jquery报错代码:$(document).ready(function() {
$('#nav').onePageNav({
begin: function() {
console.log('start')
},
end: function() {
console.log('stop')
}
});
});
报错提示:Uncaught TypeError: $(...).onePageNav is not a function;
$(...).onePageNav你的这个方法是在那里引入的?
报错代码是否位于引入的这个方法之后?
如果报错的代码在引入这个方法的JS之前,肯定会报错找不到这个方法,也就是(Uncaught TypeError: $(...).onePageNav is not a function;)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。