<script>
jQuery(document).ready(function() {
var carousel = jQuery(".service-slider");
jQuery(".service-slider").owlCarousel({
items: 3,
loop: true,
margin: 1,
autoplay:true,
autoplayTimeout:2000,
autoplayHoverPause:true,
center: true,
onInitialized : counter,
onTranslated : counter,
responsive: {
0: {
items: 1,
nav: true,
dots: false,
},
575: {
items: 2,
nav: true,
dots: false,
},
767: {
items: 2,
nav: true,
dots: false,
},
980: {
items: 2,
nav: true,
dots: false,
},
1000: {
items: 2,
nav: true,
dots: false,
},
1280: {
items: 3,
nav: true,
dots: false,
}
},
});
function counter(e) {
var ele = e.target;
var items = e.item.count;
var item = e.item.index + 1;
if(item > items) {
item = item - items
}
if(items<10){
jQuery('#number-count').html("<span class=''>0"+item+"</span><span class='divider'> |</span><span class='all-items'> 0"+items+"</span>");
} else{
jQuery('#number-count').html("<span class=''>0"+item+"</span><span class='divider'> |</span><span class='all-items'>"+items+"</span>");
}
}
});
</script>
No comments:
Post a Comment