I'm working on this website and I don't currently know how to test this on iOS for free. I'm trying JavaScript out. Should this function? Sorry, I think I'm still a little new. Thanks
const navbarElement = document.querySelectorAll('.navbar .subnav #raiseup img.catalogue-img');
navbarElement.addEventListener('touchstart', function(e) {
e.preventDefault(); // Prevents the default touch behavior
this.classList.toggle('hovered');
});
// Optional: Remove the class on touchend or touchcancel
navbarElement.addEventListener('touchend', function() {
this.classList.remove('hovered');
});
navbarElement.addEventListener('touchcancel', function() {
this.classList.remove('hovered');
});