Reputation: 1399
On my wordpress site i use jQuery 1.12.4 together with owl carousel 2.2. When i load an carousel i get the following error:
TypeError: this.$element.attr(...) is undefined
The carousel is not working. jQuery is loadad in the header and owl carousel in the footer. I call owl carousel in a js file which is loadad after the owl carousel js:
jQuery(document).ready(function($) {
$("#services-slider").owlCarousel();
});
Upvotes: 1
Views: 2058
Reputation: 540
Just minute ago have the same problem on Wordpress...
Look:
id="services-slider"
- must be only ONE element with id="services-slider"
on pageid="services-slider"
must have class="owl-carousel"
Upvotes: 2
Reputation: 116
Just add any class to your #services-slider element. For examle
<div id="services-slider" class="owl-carousel">
....
</div>
Upvotes: 7