Load three JS plugins
<script src="./js/jquery/jquery.js"></script><script src="./js/jquery/swiper.min.js"></script><script src="./js/jquery/zepto.min.js"></script>简单代码:操作一块元素的上下位移。$("#js_showdown_show").on("swipeDown",function(){ $(".js_showdown").stop(); $("#js_showdown_show").stop(); $(this).animate({ marginTop: "171px" }, 500 ); $(".js_showdown").animate({ marginTop: "171px" }, 500 ); document.addEventListener(‘touchmove‘, function (event) { event.preventDefault(); }, false);});$(document).on(‘swipeUp‘,function(e){ $(".js_showdown").stop(); $("#js_showdown_show").stop(); $(‘#js_showdown_show‘).animate({ marginTop: "0px" }, 500 ); $(".js_showdown").animate({ marginTop: "0px" }, 500 ); document.addEventListener(‘touchmove‘, function (event) { event.returnValue = true; }, false);});
Mobile Browsing page Touch operation to resolve touch events and browser scroll bar conflict; Zepto,swipe event.