<?php
/**
 * ------------------------------------------------------------------------
 * ja_trip_tpl
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2018 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - Copyrighted Commercial Software
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites:  http://www.joomlart.com -  http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 * ------------------------------------------------------------------------
 */

defined('_JEXEC') or die;

$count = $helper->getRows('data.gallery-image');
$col = $helper->get('number_col');
$btDesc = $helper->get('bt-desc');
?>
<div id="acm-gallery-<?php echo $module->id ;?>" class="acm-gallery style-1">
  <div>
    <div class="owl-carousel owl-theme">
  		<?php
        for ($i=0; $i < $count; $i++) :
      ?>
  		<div class="item" >
        <div class="item-inner">
            <img src="<?php echo $helper->get('data.gallery-image', $i); ?>" alt="<?php echo $helper->get('data.gallery-alt', $i); ?>" />
        </div>
  		</div>
  		<?php endfor; ?>
    </div>
  </div>
</div>

<script>
(function($){
  jQuery(document).ready(function($) {
    $("#acm-gallery-<?php echo $module->id; ?> .owl-carousel").owlCarousel({
      items: <?php echo $col ;?>,
      loop: true,
      singleItem : false,
      itemsScaleUp : true,
      nav : false,
      dots: false,
      mergeFit: true,
      slideBy: 1,
      autoplay: <?php echo $helper->get('auto_play') ? 'true' : 'false' ;?>,
      slideTransition: 'linear',
      autoplaySpeed: <?php echo $helper->get('auto_time') ? $helper->get('auto_time') : 5000;?>,
      autoplayHoverPause: true,
      margin: 10,
      responsive : {
        // breakpoint from 0 up
        0 : {
          items: 1
        },

        // breakpoint from 480 up
        480 : {
          items: 2
        },

        // breakpoint from 768 up
        768 : {
          items: 3
        },

        // breakpoint from 992 up
        992 : {
          items: <?php echo $col ;?>,
        },

        // breakpoint from 1440 up
        1440 : {
          items: <?php echo $col ;?>
        }
      }
    });
  });
})(jQuery);
</script>