TypeError: $(…).owlCarousel is not a function

前端 未结 8 875
青春惊慌失措
青春惊慌失措 2020-12-11 16:26

I am having troubles adding this carousel to my prestashop template.

It returns me the following error:

TypeError: $(...).owlCarousel is not a function navig

8条回答
  •  粉色の甜心
    2020-12-11 16:30

    I got fixed by checking if the selector exist or not. As this was the issue on my website I had added code in footer for a single page but it was throwing error or other pages where that selector don't exist.

    $(document).ready(function() {
        var owl = $('.servicesCarosal');
                
        //console.log(owl);
    
        if (owl.length) { 
            owl.owlCarousel({
    
            });
        } 
    });
    

提交回复
热议问题