Fairly new to programming and only work in Javascript (so far). I'm building a site where you can click through pictures. It works like a charm on PC, Mac and in an Android smart phone, but when I try it in iPad (Chrome) and on iPhone (both Chrome and Safari) some clicks don't trigger the functions. Is this a common problem? I add event listeners as follows.
document.getElementById("displayRight" + count).addEventListener("click", triggerRight);
The functions look like this:
function triggerRight() {
var compare = activeElement;
getIdRight();
if (compare === activeElement) {
slideIndex = slideIndex + 1;
} else {
slideIndex = 2;
}
slidePic();
}
function slidePic() {
var i;
var x = document.getElementsByClassName("mySlides" + activeElement);
if (slideIndex > x.length) {
slideIndex = 1;
}
if (slideIndex < 1) {
slideIndex = x.length;
}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[slideIndex - 1].style.display = "block";
}