I contact the front end soon, write bad please advice, welcome to point out
Recently to achieve a demand needs to realize mobile gesture operation, there are many good plug-ins found on the Internet (PS: Do not advertise, a search a lot of)
Plug-in is really good, but I want to study, then wrote a demo, to achieve the pull, pull trigger, and left and right gesture swipe trigger
Pull, pull-down trigger.
$ (window). Scroll ()//trigger when scroll bar is scrolled
ScrollTop () (height of scroll bar from top)
$ (document). Height (the total height of the current page)
$ (this). Height (the currently visible page height);
Please see the attached code below for details.
Left and right gesture swipe trigger
Using JS's AddEventListener monitor,
Listen to-touchstart events, Touchmove events, touchend events, and get the Clientx,clienty properties separately
Touchstart: Triggers when the mouse taps the screen
Touchmove: Triggers when the mouse moves through the screen
Touchend: Triggers when the mouse leaves the screen
Property: Event.touches[0].clientx,event.touches[0].clienty get x, y coordinates
Directly on the code, please advise (PS: Please use the mobile mode debugging)
<! DOCTYPE html>
About mobile gesture swipe and pull-up loading drop-down refresh simple analog notes