我想使用那个超级旋转木马,但我不明白为什么它看起来像这样。 Before grabbing
&安培;然后。刚刚做到了:
(函数($){
$('.carousel').owlCarousel({
items: 1,
});
})(jQuery);
有人能指出这个问题吗?我的样式表是否干扰了它? 努力学习,刚刚开始。 谢谢。
答案 0 :(得分:1)
绝对奇怪,但请尝试将您的班级名称更改为HTML中的owl-carousel
。
尝试以下javascript:
$(document).ready(function () {
$(".owl-carousel").owlCarousel({"items": 1});
});
根据documentation,这个类名可能是强制性的 - 无论是否仅暗示可选的默认样式我都不确定。
您不需要任何特殊标记。你所需要的只是包裹你的 div(owl适用于任何类型元素a / img / span ..)里面 容器元素
<div class="owl-carousel">
。 “owl-carousel
”类 必须使用来自owl.carousel.css
的正确样式 文件。