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');
});

Thanks for any advice!

0 Answers