I have an ontouchstart
event triggered on my mobile view, its linked to this:
function mobileLinksShow() {
document.querySelector(\'.mobile-head
Found a work around by testing the browser type and removing the onclick accordingly:
function removeMobileOnclick() {
if(isMobile()) {
document.querySelector('.mobile-head-bar-left').onclick = '';
}
}
function isMobile() {
if (navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
|| navigator.userAgent.match(/Opera Mini/i)
|| navigator.userAgent.match(/IEMobile/i)
) {
return true;
}
}
window.addEventListener('load', removeMobileOnclick);
This way you can have both onclick
and ontouchstart
not interfering
isMobile function taken from Detecting mobile devices and the webOS
part removed as this saw the desktop browser as mobile.