Edit File: scroller_init.tpl
{script src="js/lib/owlcarousel/owl.carousel.min.js"} <script type="text/javascript"> //<![CDATA[ (function(_, $) { $.ceEvent('on', 'ce.commoninit', function(context) { var elm = context.find('#scroll_list_{$block.block_id}'); var item = {$block.properties.item_quantity|default:5}, // default setting of carousel itemsDesktop = 4, itemsDesktopSmall = 3; itemsTablet = 2; if (item > 3) { itemsDesktop = item; itemsDesktopSmall = item - 1; itemsTablet = item - 2; } else if (item == 1) { itemsDesktop = itemsDesktopSmall = itemsTablet = 1; } else { itemsDesktop = item; itemsDesktopSmall = itemsTablet = item - 1; } if (elm.length) { elm.owlCarousel({ items: item, itemsDesktop: [1199, itemsDesktop], itemsDesktopSmall: [979, itemsDesktopSmall], itemsTablet: [768, itemsTablet], itemsMobile: [479, 1], {if $block.properties.scroll_per_page == "Y"} scrollPerPage: true, {/if} {if $block.properties.not_scroll_automatically == "Y"} autoPlay: false, {else} autoPlay: '{$block.properties.pause_delay * 1000|default:0}', {/if} slideSpeed: {$block.properties.speed|default:400}, stopOnHover: true, navigation: true, navigationText: ['{__("prev_page")}', '{__("next")}'], pagination: false }); } }); }(Tygh, Tygh.$)); //]]> </script>
Back to File Manager