Slick Carousel Uncaught TypeError: $(…).slick is not a function

前端 未结 15 1587
独厮守ぢ
独厮守ぢ 2020-12-10 00:18

Somehow I\'m unable to use slick carousel (http://kenwheeler.github.io/slick/) correctly.

I\'m getting the following error:

Uncaught TypeError: $(..         


        
15条回答
  •  执笔经年
    2020-12-10 01:10

    Try:

    function initSlider(){
        $('.references').slick({
            dots: false,
            infinite: true,
            speed: 300,
            slidesToShow: 1,
            autoplay: true,
            prevArrow: '
    ', nextArrow: '
    ' }); } $(document).on('ready', function () { initSlider(); });

    Also just to be sure, make sure that you include the JS file for the slider after you include jQuery and before you include the code above to initialise.

提交回复
热议问题