admin管理员组

文章数量:1426617

I'm trying to do a carousel with slick but it doesn't work.

This test code work well:

<script  src="jquery.min.js"></script>
<script  type="text/javascript" src="slick/slick.min.js"></script>
<script>
$('.slider').slick({
  slidesToShow: 1,
  slidesToScroll: 1,
  dots: true,
  infinite: true,
  cssEase: 'linear'
});
</script>

But this code don't work and reply me $(...).slick is not a function :

<script src="js/noframework.waypoints.min.js"></script>
<script src="js/logo-appear.js"></script>
<script src="js/skill.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="slick/slick.min.js"></script>
<script type="text/javascript">
$('.experiences').slick({
  slidesToShow: 1,
  slidesToScroll: 1,
  dots: true,
  infinite: true,
  cssEase: 'linear'
});
</script>

I tried to update the version of jQuery, to insert $(document).ready(function(){});

I'm not really good with jQuery, maybe there is a conflict with waypoint.

Thanks for your help.

I'm trying to do a carousel with slick but it doesn't work.

This test code work well:

<script  src="jquery.min.js"></script>
<script  type="text/javascript" src="slick/slick.min.js"></script>
<script>
$('.slider').slick({
  slidesToShow: 1,
  slidesToScroll: 1,
  dots: true,
  infinite: true,
  cssEase: 'linear'
});
</script>

But this code don't work and reply me $(...).slick is not a function :

<script src="js/noframework.waypoints.min.js"></script>
<script src="js/logo-appear.js"></script>
<script src="js/skill.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="slick/slick.min.js"></script>
<script type="text/javascript">
$('.experiences').slick({
  slidesToShow: 1,
  slidesToScroll: 1,
  dots: true,
  infinite: true,
  cssEase: 'linear'
});
</script>

I tried to update the version of jQuery, to insert $(document).ready(function(){});

I'm not really good with jQuery, maybe there is a conflict with waypoint.

Thanks for your help.

Share Improve this question edited Apr 3, 2020 at 13:33 Richard Dallaway 4,3301 gold badge29 silver badges39 bronze badges asked Dec 25, 2018 at 17:13 Najib TAHAR-BERRABAHNajib TAHAR-BERRABAH 811 gold badge1 silver badge5 bronze badges 10
  • Did you try removing waypoint and see what happens then? – yaakov Commented Dec 25, 2018 at 17:14
  • when i remove others js files it reply me " $ is not defined " – Najib TAHAR-BERRABAH Commented Dec 25, 2018 at 17:16
  • Just remove waypoint. – yaakov Commented Dec 25, 2018 at 17:17
  • Also, can you post any other relevant code? There isn't enough here to find the problem. – yaakov Commented Dec 25, 2018 at 17:17
  • isn't your file in the following instead: js/slick.min.js? – Ali Sheikhpour Commented Dec 25, 2018 at 17:18
 |  Show 5 more ments

2 Answers 2

Reset to default 1

You do need to guarantee that the Slick library is loaded before you try to use the slick() function. You were on the right track by considering the need for to wait until the document is "ready", as that will ensure that the Slick and jQuery libraries have been fetched. You can use the jQuery $() shorthand to check this:

$(function() {
    $('.experiences').slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        dots: true,
        infinite: true,
        cssEase: 'linear'
    });
});

Avoid to jQuery slim version.

Cross check how many jQuery being loaded

本文标签: javascriptUncaught TypeError ()slick is not a functionStack Overflow