Speical Offers
Customer Reviews
Best Sellers
TRENDING PRODUCTS
DISCOVER OUR TOP BRANDS
BUILD MORE WITH CHADWICKS
`;
slider.classList.add('glider-contain');
slider.insertAdjacentHTML(
'beforeend',
'\u000A\u003Cdiv\u0020class\u003D\u0022carousel\u002Dnav\u002Dcontainer\u0020flex\u0020flex\u002Drow\u0020justify\u002Dcenter\u0020items\u002Dcenter\u0020my\u002D6\u0022\u003E\u000A\u0020\u0020\u0020\u0020\u003Cbutton\u000A\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020aria\u002Dlabel\u003D\u0022Previous\u0022\u000A\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020class\u003D\u0022glider\u002Dprev\u0020w\u002D8\u0020h\u002D8\u0020mr\u002D1\u0020text\u002Dnavy\u002D900\u0020rounded\u002Dfull\u0020focus\u003Aoutline\u002Dnone\u0022\u003E\u000A\u0020\u0020\u0020\u0020\u0020\u0020\u003Cspan\u0020class\u003D\u0022icons\u0020bg\u002Dnavigate\u002Dleft\u002Darrow\u002Dblue\u0020w\u002D7\u0020h\u002D6\u0020bg\u002Dcontain\u0020bg\u002Dno\u002Drepeat\u0020bg\u002Dcenter\u0020block\u0020mr\u002D1\u0022\u003E\u003C\u002Fspan\u003E\u000A\u0020\u0020\u0020\u0020\u003C\u002Fbutton\u003E\u000A\u0020\u0020\u0020\u0020\u003Cdiv\u0020role\u003D\u0022tablist\u0022\u0020class\u003D\u0022glider\u002Ddots\u0020select\u002Dnone\u0020flex\u0020flex\u002Dwrap\u0020mx\u002D1\u0020justify\u002Dcenter\u0020p\u002D0\u0022\u003E\u003C\u002Fdiv\u003E\u000A\u0020\u0020\u0020\u0020\u003Cbutton\u000A\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020aria\u002Dlabel\u003D\u0022Next\u0022\u000A\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020class\u003D\u0022glider\u002Dnext\u0020w\u002D8\u0020h\u002D8\u0020ml\u002D1\u0020text\u002Dnavy\u002D900\u0020rounded\u002Dfull\u0020focus\u003Aoutline\u002Dnone\u0022\u003E\u000A\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u003Cspan\u0020class\u003D\u0022icons\u0020bg\u002Dnavigate\u002Dright\u002Darrow\u002Dblue\u0020w\u002D7\u0020h\u002D6\u0020bg\u002Dcontain\u0020bg\u002Dno\u002Drepeat\u0020bg\u002Dcenter\u0020block\u0020mr\u002D1\u0022\u003E\u003C\u002Fspan\u003E\u000A\u0020\u0020\u0020\u0020\u003C\u002Fbutton\u003E\u000A\u003C\u002Fdiv\u003E\u000A'
);
const gliderElement = slider.querySelector('.slider-group');
const gliderDots = slider.querySelector('.glider-dots');
const gliderPrev = slider.querySelector('.glider-prev');
const gliderNext = slider.querySelector('.glider-next');
new Glider(gliderElement, {
responsive: [
{
breakpoint: 300,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
scrollLock: true,
scrollLockDelay: 250,
draggable: false,
dragVelocity: 2.5,
dots: gliderDots,
rewind: true,
swipeThreshold: false,
arrows: {
prev: gliderPrev,
next: gliderNext,
},
}
},
{
breakpoint: 765,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
scrollLock: true,
scrollLockDelay: 250,
draggable: false,
dragVelocity: 2.5,
dots: gliderDots,
rewind: true,
swipeThreshold: false,
arrows: {
prev: gliderPrev,
next: gliderNext,
},
}
}
]
});
slider.classList.add('glider-initialized');
// if (slider.dataset.showArrows === 'true') {
gliderPrev.classList.remove('hidden');
gliderNext.classList.remove('hidden');
// }
hideOnePageSliderControls(slider, gliderDots);
};
const hideOnePageSliderControls = (slider, gliderDotsContainer) => {
if (gliderDotsContainer.children.length <= 1) {
// no elements to slide through
const carouselNavContainer = slider.querySelector('.carousel-nav-container');
carouselNavContainer && carouselNavContainer.classList.add('hidden');
}
};
const hideScrollBar = (gliderElement) => {
gliderElement.classList.add('overflow-x-hidden');
};
elements.forEach(element => {
if (element.classList.contains('home-page-advertisement-row')) {
initSliderCarousel(element);
}
if (element.classList.contains('home-page-discover-brands-row')) {
initSliderCarouselMultipleItems(element);
}
});
};
const isLibraryScriptLoaded = () => {
return typeof Glider !== 'undefined';
};
// fix for pages where cms block is not ready before script running
const onDomIsRendered = (domSelector) => {
return new Promise(function (resolve, reject) {
function waitUntil() {
setTimeout(function () {
if (document.querySelectorAll(domSelector).length > 0) {
resolve(document.querySelectorAll(domSelector));
} else {
waitUntil();
}
}, 100);
}
waitUntil();
});
};
document.addEventListener("DOMContentLoaded", () => {
setTimeout(function () {
const carouselElements = document.querySelectorAll(
`.home-page-slider-block`
);
if (carouselElements.length !== 0) {
if (isLibraryScriptLoaded()) {
initCarousels(carouselElements);
} else {
const script = document.createElement('script');
script.type = 'text/javascript';
script.addEventListener('DOMContentLoaded', () => {
initCarousels(carouselElements);
});
script.src = 'https\u003A\u002F\u002Fwww.chadwicks.ie\u002Fstatic\u002Fversion1729869459\u002Ffrontend\u002FChadwicks\u002Fdefault\u002Fen_US\u002FHyva_PageBuilder\u002Fjs\u002Fglider.min.js';
document.head.appendChild(script);
}
}
}, 500);
});
})();