简体   繁体   中英

Uncaught typeError: Cannot read property 'owlCarousel' of null

I am having a jQuery Issue, Understand I am no jQuery expert so bear with me. I am trying to install this Owl Responsive slider on magento and I am having an issue with this "

Uncaught typeError: Cannot read property 'owlCarousel' of null in Chrome console

Uncaught typeError的屏幕截图:无法读取null的属性'owlCarousel'

Thanks.

By default magento use prototypejs framework which uses $ as global variable. if you include other javascript plugins like jQuery which also use $ as global variable, there will be a clash in variables related to prototypejs and jquery. This conflict can be resolved by assigning different name to global variable of jquery plugin.

To do that, use the following code above in all files wherever you are planning to use jQuery instead of prototype.

jQuery.noConflict();

That means you should use jQuery instead of $ . Something like this:

jQuery("#owl-demo");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM