Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install jQuery plugin?

I've been trying to install the NiceScroll plugin, which makes the scrolling much smoother. The website is http://areaaperta.com/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.com/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.

like image 969
GarrettSadFace Avatar asked Apr 19 '14 23:04

GarrettSadFace


People also ask

How do I get jQuery plugins?

There are plenty of jQuery plug-in available which you can download from repository link at https://jquery.com/plugins.

How do I add jQuery to my HTML?

Step 1: Open the HTML file in which you want to add your jQuery with the help of CDN. Step 2: Add <script> tag between the head tag and the title tag which will specify the src attribute for adding your jQuery. Step 3: After that, you have to add the following path in the src attribute of the script tag.


2 Answers

you need to add the http:// protocol.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
like image 161
Bary12 Avatar answered Sep 18 '22 11:09

Bary12


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.com/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>
like image 40
roshiro Avatar answered Sep 18 '22 11:09

roshiro