未捕获的TypeError:undefined不是函数 - 使用Owl Carousel

时间:2015-01-15 22:42:27

标签: javascript jquery magento magento-1.8 owl-carousel

我在Magento网站上使用猫头鹰旋转木马,我可以正确显示幻灯片,但无法使用任何功能控制滑块...这里是我的HTML代码:

<div id="main-slider" class="owl-carousel mobile-slider">
<div class="item">{{block type="cms/block" block_id="block_slide1"}}</div>
<div class="item">{{block type="cms/block" block_id="block_slide2"}}</div>
<div class="item">{{block type="cms/block" block_id="block_slide3"}}</div>
<div class="item">{{block type="cms/block" block_id="block_slide4"}}</div>
<div class="item">{{block type="cms/block" block_id="block_slide5"}}</div>
</div>

这是我在上面的html之后直接放置的控件:

jQuery(document).ready(function(){
  jQuery('#main-slider').owlCarousel({

    singleItem: true,
    slideSpeed: 200,
    stopOnHover: true,
    navigation: true
  }); 
});

这是我回来的控制台中的错误:

Uncaught TypeError: undefined is not a function

在我的标题中,我有:

<link rel="stylesheet" type="text/css" href="js/nwdthemes/owl-carousel/owl.carousel.css" />
<link rel="stylesheet" type="text/css" href="js/nwdthemes/owl-carousel/owl.theme.css" />
<link rel="stylesheet" type="text/css" href="js/nwdthemes/owl-carousel/owl.transitions.css" />
<script type="text/javascript" src="js/nwdthemes/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/nwdthemes/owl-carousel/owl.carousel.min.js"></script>

这是旋转木马的输出,&#39; singleItem:true&#39;似乎没有工作,因为它一次显示2张幻灯片:

enter image description here

1 个答案:

答案 0 :(得分:0)

{
    // ...
    stopOnHover: false,
    autoplayHoverPause:true,
    // ...
}