Mobile Browsing page Touch operation to resolve touch events and browser scroll bar conflict; Zepto,swipe event.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.