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
2 Answers
Reset to default 1You 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
版权声明:本文标题:javascript - Uncaught TypeError: $(...).slick is not a function - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745480805a2660162.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论