最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to install jQuery plugin? - Stack Overflow

programmeradmin4浏览0评论

I've been trying to install the NiceScroll plugin, which makes the scrolling much smoother. The website is .html and I can't seem to figure out how to install it. I really don't understand the instructions. It isn't working, and I have no idea what I'm doing as I don't understand jQuery. Here's my code:

<script src="//ajax.googleapis/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="C:\Users\haines\Desktop\Music\resource\jquery.nicescroll.js"></script>
<script src="C:\Users\haines\Desktop\Music\resource\jquery.nicescroll.min.js"></script>

<script>
var seq = 0;
$(document).ready(

function() { 

$("html").niceScroll();

}

);
</script>

It's in the header, by the way.

I've been trying to install the NiceScroll plugin, which makes the scrolling much smoother. The website is http://areaaperta./nicescroll/index.html and I can't seem to figure out how to install it. I really don't understand the instructions. It isn't working, and I have no idea what I'm doing as I don't understand jQuery. Here's my code:

<script src="//ajax.googleapis./ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="C:\Users\haines\Desktop\Music\resource\jquery.nicescroll.js"></script>
<script src="C:\Users\haines\Desktop\Music\resource\jquery.nicescroll.min.js"></script>

<script>
var seq = 0;
$(document).ready(

function() { 

$("html").niceScroll();

}

);
</script>

It's in the header, by the way.

Share Improve this question asked Apr 19, 2014 at 23:57 GarrettSadFaceGarrettSadFace 2251 gold badge3 silver badges9 bronze badges 1
  • Just a side note: Try to use relative URLs in your src instead of absolute URLs. When you deploy or move your app, you will thank yourself. – maahd Commented Jun 22, 2015 at 13:15
Add a ment  | 

2 Answers 2

Reset to default 4

you need to add the http:// protocol.

<script src="http://ajax.googleapis./ajax/libs/jquery/1.8.1/jquery.min.js"></script>

Try this. You need either jquery.nicescroll.min.js or jquery.nicescroll.js, and you don't need to wrap $("html").niceScroll(); in a function.

<script src="http://ajax.googleapis./ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="C:\Users\haines\Desktop\Music\resource\jquery.nicescroll.min.js"></script>

<script>
  $(document).ready(
    $("html").niceScroll();
  );
</script>
发布评论

评论列表(0)

  1. 暂无评论