I'm trying to use slick carousel with Foundation 6.5 and can't seem to get it to work.
I put the basic HTMl Markup
<div class="slick-test">
<div>your content</div>
<div>your content</div>
<div>your content</div>
</div>
I added the js files to app.js, I changed from import to require() which seemed to fix an issue I was having with the slick script.
require('../../../node_modules/slick-carousel');
require('../../../node_modules/slick-carousel/slick/slick');
require('./slick-scripts');
In slick-scripts I put a basic script
$(document).ready(function(){
$('.slick-test').slick({
infinite: true,
slidesToShow: 3,
slidesToScroll: 3
});
});
I'm still getting the following error
slick-scripts.js:1 Uncaught ReferenceError: $ is not defined
at Object../src/assets/js/slick-scripts.js (slick-scripts.js:1)
at __webpack_require__ (bootstrap:19)
at Module../src/assets/js/app.js (app.js:18)
at __webpack_require__ (bootstrap:19)
at Object.0 (app.js:24299)
at __webpack_require__ (bootstrap:19)
at bootstrap:83
at bootstrap:83
I thought these types of $ is not defined were if the script was loading before jquery? I believe with the require() script this would load after JQuery?
Uncaught ReferenceError: $ is not defined?
Is there another way that I should format the script?
Here is a screenshot of the full app.js file in case I have something in the wrong place.