html - Swiping on webpage makes browser go to previous page -


i'm trying add swipe functionality lightbox2. works, whenever swipe back, browser goes previous page (i think it's feature on touchscreen computers).

here script i'm using capture swipe

    jquery(document).ready(function () {       $(".lb-container").on("swipeleft",function(){         $('#lightbox a.lb-next').trigger('click');       });       $(".lb-container").on("swiperight",function(){         $('#lightbox a.lb-prev').trigger('click');       });     }); 

thanks

edit:

i getting following error:

unable preventdefault inside passive event listener due target being treated passive. see https://www.chromestatus.com/features/5093566007214080

swiperight , swipeleft not events in jquery found in jquery mobile (unfortunately last updated in 2014). add jquery mobile page or use plugin touchswipe add swipe direction events.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -