0byt3m1n1
Path:
/
home
/
kassiope
/
www
/
lib
/
js
/
libs
/
[
Home
]
File: carousel.js
$(".owl-home").owlCarousel({ transitionStyle : "fade", margin: 0, stagePadding: 0, nav:false, dots: true, loop:true, animateOut: 'fadeOut', animateIn: 'fadeIn', autoplay:true, autoplayTimeout:5000, responsive: { 0:{ items:1 }, 600: { items: 1 }, 768: { items: 1, }, 1200: { items: 1 } } }); $(".owl-prods").owlCarousel({ transitionStyle : "fade", margin: 15, stagePadding: 0, nav:false, dots: false, loop:true, responsive: { 0:{ items:1 }, 600: { items: 1 }, 768: { items: 2, }, 1200: { items: 4 } } }); $(".owl-reals").owlCarousel({ transitionStyle : "fade", margin: 15, stagePadding: 0, nav:false, dots: false, loop:true, responsive: { 0:{ items:1 }, 600: { items: 1 }, 768: { items: 2, }, 1200: { items: 3 } } }); $(".owl-videos").owlCarousel({ transitionStyle : "fade", margin: 15, stagePadding: 0, nav:false, dots: false, loop:true, responsive: { 0:{ items:1 }, 600: { items: 1 }, 768: { items: 2, }, 1200: { items: 3 } } }); $(".owl-actus").owlCarousel({ transitionStyle : "fade", margin: 15, stagePadding: 0, nav:false, dots: false, loop:true, responsive: { 0:{ items:1 }, 600: { items: 1 }, 768: { items: 2, }, 1200: { items: 5 } } }); // naviguation btn var owl = $('.owl-prods'); owl.owlCarousel(); // Go to the next item $('.next[data-id="1"]').click(function() { owl.trigger('next.owl.carousel'); }) // Go to the previous item $('.prev[data-id="1"]').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' owl.trigger('prev.owl.carousel', [300]); }) // naviguation btn var video = $('.owl-videos'); video.owlCarousel(); // Go to the next item $('.next[data-id="2"]').click(function() { video.trigger('next.owl.carousel'); }) // Go to the previous item $('.prev[data-id="2"]').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' video.trigger('prev.owldataid.carousel', [300]); }) // naviguation btn var reals = $('.owl-reals'); reals.owlCarousel(); // Go to the next item $('.next').click(function() { var dataid = $(this).data("id"); var reals = $('.real-'+dataid); reals.trigger('next.owl.carousel'); }) // Go to the previous item $('.prev').click(function() { var dataid = $(this).data("id"); var reals = $('.real-'+dataid); reals.trigger('prev.owl.carousel', [300]); }) // naviguation btn var actu = $('.owl-actus'); actu.owlCarousel(); // Go to the next item $('.next[data-id="3"]').click(function() { actu.trigger('next.owl.carousel'); }) // Go to the previous item $('.prev[data-id="3"]').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' actu.trigger('prev.owl.carousel', [300]); }) $(".owl-cats").owlCarousel({ transitionStyle : "fade", margin: 30, autoWidth:true, stagePadding: 20, nav:false, dots: false, loop:false, }); // naviguation btn var cats = $('.owl-cats'); cats.owlCarousel(); // Go to the next item $('.cats-next').click(function() { cats.trigger('next.owl.carousel'); }) // Go to the previous item $('.cats-prev').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' cats.trigger('prev.owl.carousel', [300]); }) var sync1 = $(".sync1"); var sync2 = $(".sync2"); var slidesPerPage = 4; //globaly define number of elements per page var syncedSecondary = true; sync1.owlCarousel({ items: 1, slideSpeed: 2000, nav: false, autoplay: false, dots: false, loop: true, responsiveRefreshRate: 200, }).on('changed.owl.carousel', syncPosition); sync2 .on('initialized.owl.carousel', function() { sync2.find(".owl-item").eq(0).addClass("current"); }) .owlCarousel({ items: slidesPerPage, margin: 20, 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 }).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); 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 (current > end) { sync2.data('owl.carousel').to(current, 100, true); } if (current < start) { sync2.data('owl.carousel').to(current - onscreen, 100, true); } } function syncPosition2(el) { if (syncedSecondary) { var number = el.item.index; 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); }); // naviguation btn var thumbs = $('.owl-prod'); thumbs.owlCarousel(); // Go to the next item $('.nextslide').click(function() { thumbs.trigger('next.owl.carousel'); }) // Go to the previous item $('.prevslide').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' thumbs.trigger('prev.owl.carousel', [300]); }) $(".owl-assoc").owlCarousel({ transitionStyle : "fade", margin: 15, stagePadding: 0, nav:false, dots: false, loop:true, responsive: { 0:{ items:1 }, 600: { items: 1 }, 768: { items: 2, }, 1200: { items: 4 } } }); // naviguation btn var associate = $('.owl-assoc'); associate.owlCarousel(); // Go to the next item $('.next[data-id="4"]').click(function() { associate.trigger('next.owl.carousel'); }) // Go to the previous item $('.prev[data-id="4"]').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' associate.trigger('prev.owl.carousel', [300]); }) $(".owl-altern").owlCarousel({ transitionStyle : "fade", margin: 15, stagePadding: 0, nav:false, dots: false, loop:true, responsive: { 0:{ items:1 }, 600: { items: 1 }, 768: { items: 2, }, 1200: { items: 4 } } }); // naviguation btn var alternatif = $('.owl-altern'); alternatif.owlCarousel(); // Go to the next item $('.next[data-id="5"]').click(function() { alternatif.trigger('next.owl.carousel'); }) // Go to the previous item $('.prev[data-id="5"]').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' alternatif.trigger('prev.owl.carousel', [300]); })