Currently utilizing Swipe JS to generate a full-screen image gallery and aiming to incorporate the functionality of clicking on the left or right edge to navigate between the previous and next slides.
An attempt was made to create absolutely positioned a
tags, however, this caused issues with the swipe feature as swiping couldn't be initiated on the links.
To resolve this issue, it was considered to pass the event to the correct element:
document.getElementById('next').addEventListener('touchstart', function(e){
document.getElementById('swipe-wrap').dispatchEvent(e);
}, false);
This implementation resulted in the following error:
Uncaught InvalidStateError: Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.
Seeking advice on how to effectively pass along the event or suggestions for an alternative approach.