如何在opencart 2.2.0中自动运行Carousel Module

时间:2016-08-16 11:22:49

标签: opencart carousel

请告诉我carousel.tpl的auto run carousel模块?我是opencart的新人,请帮助我。我已经用JS编辑了。

    <div id="carousel-<?php echo $module; ?>" class="banners-slider-carousel">
<?php /*?><div class="box-heading"><span class="heading_inner">Our Brands</span></div><?php */?>
    <div class="customNavigation">
        <a class="btn prev">&nbsp;</a>
        <a class="btn next">&nbsp;</a>
    </div>
  <div class="product-carousel" id="module-<?php echo $module; ?>-carousel">
    <?php foreach ($banners as $banner) { ?>
        <div class="slider-item">
        <div class="product-block">
        <div class="product-block-inner">
            <?php if ($banner['link']) { ?>
   <a href="<?php echo $banner['link']; ?>"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" /></a>
    <?php } else { ?>
    <img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" />
    <?php } ?>
        </div></div></div>
    <?php } ?>
  </div>
</div>
<span class="module_default_width" style="display:none; visibility:hidden"></span>


<script type="text/javascript"><!--
$('#carousel-<?php echo $module; ?>-carousel').jcarousel({
items: 6,
autoPlay: 3000,
navigation: true,
navigationText: ['<i class="fa fa-chevron-left fa-5x"></i>', '<i class="fa fa-chevron-right fa-5x"></i>'],
pagination: true
});
--></script>

1 个答案:

答案 0 :(得分:0)

试试这个脚本

<script type="text/javascript"><!--
$('#module-<?php echo $module; ?>-carousel').owlCarousel({
items: 6,
autoPlay: 3000,
navigation: true,
navigationText: ['<i class="fa fa-chevron-left fa-5x"></i>', '<i class="fa fa-chevron-right fa-5x"></i>'],
pagination: true
});
--></script>