2015-05-18 83 views
7

我正在尝试实现恒星插件,据我所知,我已经包含了所有必需的js。然而,在开发工具控制台中,我总是收到'Uncaught TypeError:$(...)。恒星不是函数'。

这是我的头部标签:

<!DOCTYPE html> 
<html lang="en"> 
<head> 
<meta charset="UFT-8" /> 
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
<title>QE | Welcome</title> 
<link rel="stylesheet" href="css/foundation.css" /> 
<link rel="stylesheet" href="css/stuff.css"/> 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" /> 
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> 
<script src="js/jquery.stellar.js"></script> 
<script src="js/scrip.js"></script> 
<script src="js/jquery.nicescroll.js"></script> 

而这是scrip.js文件错误指的是:

$(document).ready(function() { 
    $(window).stellar(); 

}); 

$(document).ready(

    function() { 

    $("html").niceScroll({ 
     cursorcolor:"rgba(30,30,30,.5)", 
     zindex:999, 
     scrollspeed:100, 
     mousescrollstep:50, 
     cursorborder:"0px solid #fff", 
    }); 

}); 

请帮助我

+2

在Devtools的Network选项卡上,你是否正确地获取了'js/jquery.stellar.js'脚本? – GregL

+0

是js/jquery.stellar.js状态为''已完成' – Seb

+0

响应数据是该文件的内容吗? – GregL

回答

2

我发现问题是与js /供应商/ jquery.js这是我忘记了临屋区t已经将它放在index.html文件的底部。当我删除它,恒星功能工作。不知道为什么会影响stellar.js。

+3

1.加载jQuery。 2.为jQuery添加恒星。加载一个覆盖旧的jQuery的新jQuery(包括添加到它的任何东西)。 – Quentin

相关问题