Fanshop international

Alle ansehen

Fanshop national

Alle ansehen
$(document).ready(function(){ waitForElementToDisplay(".promo-al-1 .list-item-carousel",200,1000); waitForElementToDisplay2(".promo-al-2 .list-item-carousel",200,1000); waitForElementToDisplay3(".promo-al-3 .list-item-carousel",200,1000); }); function waitForElementToDisplay(selector, time,tries) { if(document.querySelector(selector)!=null) { $(selector).data('owl.carousel').destroy(); $(selector).owlCarousel({ loop:true, margin:10, nav:true, responsive:{ 0:{ items:2 }, 600:{ items:3 }, 1000:{ items:6 } } }); return; } else { if(tries >= 1){ setTimeout(function() { waitForElementToDisplay(selector, time,tries-1); }, time); }else{ return; } } } function waitForElementToDisplay2(selector, time,tries) { if(document.querySelector(selector)!=null) { $(selector).data('owl.carousel').destroy(); $(selector).owlCarousel({ loop:true, margin:10, nav:true, responsive:{ 0:{ items:2 }, 600:{ items:3 }, 1000:{ items:6 } } }); return; } else { if(tries >= 1){ setTimeout(function() { waitForElementToDisplay(selector, time,tries-1); }, time); }else{ return; } } } function waitForElementToDisplay3(selector, time,tries) { if(document.querySelector(selector)!=null) { $(selector).data('owl.carousel').destroy(); $(selector).owlCarousel({ loop:true, margin:10, nav:true, responsive:{ 0:{ items:2 }, 600:{ items:3 }, 1000:{ items:6 } } }); return; } else { if(tries >= 1){ setTimeout(function() { waitForElementToDisplay(selector, time,tries-1); }, time); }else{ return; } } }