Opening Hours : Monday to Friday 8.00 to 5.00 and Saturday 8.30 to 12.30
if (document.getElementById("slider--text")) {
let slides = [
"
Please place orders on our website or call us on 01428 658487 for specific items and advice on products
",
"
website currently under repricing and some prices may be incorrect
"
];
let i = 0;
const slider = () => {
document.getElementById("slider--text").innerHTML = slides[i];
document.getElementById("slider--text").classList.add('fade-in');
(i < slides.length - 1) ? i++ : i = 0;
};
slider(); // Start slider immediately
setInterval(slider, 4000); // Slide every 4 seconds
}
const mediaQuery = '(max-width: 765px)';
const mediaQueryList = window.matchMedia(mediaQuery);
function openNav() {
document.body.className += ' body-no-scroll';
document.getElementById("myNav").style.width = "100%";
}
function closeNav() {
document.body.className = document.body.className.replace("body-no-scroll","");
document.getElementById("myNav").style.width = "0%";
}
mediaQueryList.addEventListener('change', event => {
console.log(window.innerWidth);
if (event.matches) {
console.log('The window is now 765px or under');
} else {
console.log('The window is now over 765px');
$('ul.nav__list ').removeAttr('style');
$('ul.menu__list ul').removeAttr('style');
}
})
function clickHandler() {
$(this).find('ul').slideToggle();
}
function myFunction(x) {
if (x.matches) { // If media query matches
console.log('xxxxx')
const ul = document.querySelectorAll('li.nav__listitem');
for (let i = 0; i <= ul.length - 1; i++) {
console.log(ul[i]);
ul[i].addEventListener("click", clickHandler)
}
} else {
console.log('yyyy')
const ul = document.querySelectorAll('li.nav__listitem');
for (let i = 0; i <= ul.length - 1; i++) {
//console.log(ul[i]);
ul[i].removeEventListener("click", clickHandler)
}
}
}
var x = window.matchMedia("(max-width: 765px)")
myFunction(x) // Call listener function at run time
x.addListener(myFunction) // Attach listener function on state changes
x server