开发者社区> 问答> 正文

导航要跟着鼠标滚动向下滚动,用了jquery插件但是报错,请问大牛是什么原因?

导航要跟着鼠标向下滚动,用了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;

展开
收起
杨冬芳 2016-06-21 13:23:45 2585 0
1 条回答
写回答
取消 提交回答
  • IT从业

    $(...).onePageNav你的这个方法是在那里引入的?
    报错代码是否位于引入的这个方法之后?
    如果报错的代码在引入这个方法的JS之前,肯定会报错找不到这个方法,也就是(Uncaught TypeError: $(...).onePageNav is not a function;)

    2019-07-17 19:44:46
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
3D动画的菜谱式灯光与云渲染 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关实验场景

更多