0

I have tried disable link redirect on hybrid device (touchscreen laptop) by using event.stopPropagation() method and also event.preventDefault() method in event handler 'onpointerdown'. But it seems that is not working at all. Logs says that event was triggered but method does not stop redirect propagation. I am using onpointer down as alternative way for "touchstart" handling in IE/Edge which has not "touch" event presented as I have read.

There is my code

$('.main-menu u li a').on('pointerdown', function (e) {
    console.log('pointer down on menu');
    e.preventDefault();
    e.stopPropagation();
    $(this).find('.megamenu').addClass('open');
});
Cœur
  • 37,241
  • 25
  • 195
  • 267
Jayme
  • 45
  • 2
  • 10
  • 3
    `preventDefualt` you have a misspelling. It's likely that this is causing a runtime error and thus the rest of the code won't be executed. – James Sep 19 '17 at 13:50
  • oh well, this misspelling I made when type so it's not presented in code in real, but thanks for warning – Jayme Sep 19 '17 at 13:54

0 Answers0