加载三个js插件
<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);
});