เช่ารถ Altis 999

', ''], // slideBy:slidesPerPage, autoHeight:false, responsiveRefreshRate : 200, responsive:{ 0:{ // nav: true, // navText:['', ''], dots:true }, 640:{ nav: true, dots:false } } }).on('changed.owl.carousel', syncPosition); sync2 .on('initialized.owl.carousel', function () { sync2.find(".owl-item").eq(0).addClass("current"); }) .owlCarousel({ items : 3, dots: false, nav: false, smartSpeed: 200, slideSpeed : 500, // slideBy: slidesPerPage, //alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel responsiveRefreshRate : 100, navText:['', ''], responsive:{ 0:{ items:2, // slideBy: slidesPerPage }, 640:{ items:2, // slideBy: slidesPerPage }, 991:{ items:3, // slideBy: slidesPerPage } } }).on('changed.owl.carousel', syncPosition2); function syncPosition(el) { //if you set loop to false, you have to restore this next line //var current = el.item.index; //if you disable loop you have to comment this block var count = el.item.count-1; var current = Math.round(el.item.index - (el.item.count/2) - .5); // console.log("count = " + count); // console.log("current = " + current); if(current < 0) { current = count; } if(current > count) { current = 0; } //end block sync2 .find(".owl-item") .removeClass("current") .eq(current) .addClass("current"); var onscreen = sync2.find('.owl-item.active').length - 1; var start = sync2.find('.owl-item.active').first().index(); var end = sync2.find('.owl-item.active').last().index(); if(count - end <= onscreen) { syncedSecondary = false; } else if(current == count && start <= 0) { syncedSecondary = false; } else{ syncedSecondary = true; } // console.log("aftercurrent = " + current); // console.log("onscreen = " + onscreen); // console.log("start = " + start); // console.log("end = " + end); sync2.data('owl.carousel').to(current, 100, true); } function syncPosition2(el) { if(syncedSecondary) { var number = el.item.index; //console.log("syn2 number = " + number); sync1.data('owl.carousel').to(number, 100, true); } } sync2.on("click", ".owl-item", function(e){ e.preventDefault(); var number = $(this).index(); sync1.data('owl.carousel').to(number, 300, true); //console.log("thumbnail" + $(this).index()) }); sync1.on("click", ".owl-item", function(e){ //console.log($(this).index()) }); sync2.on("click", ".owl-next", function(e){ e.preventDefault(); sync1.trigger('next.owl.carousel'); //console.log(sync1.index()) }); sync2.on("click", ".owl-prev", function(e){ e.preventDefault(); sync1.trigger('prev.owl.carousel'); //console.log(sync1.index()) }); /* END New home video Carousal*/