J
J
Joni_52017-10-09 17:20:04
iPhone
Joni_5, 2017-10-09 17:20:04

Links won't open on iPad. On a normal desktop everything is ok. Perhaps a problem with ontouchstart?

dev.thecultureofart.com/about
Links not working on main div. And on desktop everything is ok.
It looks like part of the code:

function _initCaleoMouseWheel() {
    if ( $('.hijack-page').length > 0 ) {
  
    // call initScrollHijack
    if ( feature.touch && vpW >= 768 && (vpW >= 1051 || vpH >= 470) ) {
      //console.log('activate swiping');
      $('body').on('touchstart', '.side-draggable', false, _touchStartOvertake);
      $('body').on('touchend', '.side-draggable', false, _touchEndOvertake);
    } else {

      window.addEventListener('mousewheel', scrollOvertake, false);
      window.addEventListener('wheel', scrollOvertake, false);
    }
  
    } else {
  
    if ( vpW < 768 || (vpW < 1050 && vpH < 470) ) {
      window.removeEventListener('mousewheel', scrollOvertake, false);
      window.removeEventListener('wheel', scrollOvertake, false);
    }
  
    $('body').off('touchstart', '.side-draggable', false, _touchStartOvertake);
    $('body').off('touchend', '.side-draggable', false, _touchEndOvertake);
  
    }
  }

somehow overlaps the moment of clicking on the link. An example of a link is on the last slide. (link to instagram)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Joni_5, 2017-10-11
@Joni_5

Understood.
The problem was in the touchstart event.
In the handler of this event (_touchStartOvertake), I set the click on the link to be processed as a link
// touched a link as first
if ( e.target.nodeName === 'A' ) {
clickedHref = e.target.href ;
document.location.href = clickedHref;
e.preventDefault();
return false;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question