Nerd Zilla
Nerd Zilla

Reputation: 35

jQuery plugin slick (carousel) not working

i'm busy with making my own webpage about technology. So now I want to add a carousel plugin from slick (http://kenwheeler.github.io/slick/) but is does not work. Does anybody know why? And yes all the files are included in the root folder where all the files are.

<html>
<head>
<link rel= "stylesheet" type="text/css" href="CSS_Header.css"/>
<link rel="stylesheet" type="text/css" href="slick/slick.css"/>
</head>
<body>

<div class="your-class">
  <div><img src="slide1.png" /></div>
  <div><img src="slide1.png" /></div>
  <div><img src="slide1.png" /></div>
</div>

    <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
    <script type="text/javascript" src="slick/slick.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function(){
            $('.autoplay').slick({
                slidesToShow: 3,
                slidesToScroll: 1,
                autoplay: true,
                autoplaySpeed: 2000,  
            });
        });
         $('.your-class').slick();
    </script>

</body>
</html>

Upvotes: 0

Views: 13085

Answers (2)

JcDenton86
JcDenton86

Reputation: 932

in case you didn't fix your issue yet

Taken from your error log, it seems that it's trying to load jQuery and jQuery-migrate from a local directory, while you mean (I believe) to load from CDN. Try changing the 'src' attribute to this:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>

and see if it loads correctly then. Hope it helps

Upvotes: 2

Nerd Zilla
Nerd Zilla

Reputation: 35

Well, i found these errors:

Failed to load resource: net::ERR_FILE_NOT_FOUND
file://code.jquery.com/jquery-1.11.0.min.js

Failed to load resource: net::ERR_FILE_NOT_FOUND
file://code.jquery.com/jquery-migrate-1.2.1.min.js

Uncaught ReferenceError: jQuery is not defined
slick.min.js:1

Uncaught ReferenceError: $ is not defined
Index.html:66

Upvotes: 0

Related Questions