PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 开发编程 > JavaScript教程 > 正文

    手机划屏监控事件touchSwipe.js

    作者:admin来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:今天同事分享一个监听手机划屏事件的代码,首页的先引用一个jquery插件 touchSwipe.js(点击下载),下面就是主要代码分享$("#body").swipe(...
    今天同事分享一个监听手机划屏事件的代码,首页的先引用一个jquery插件 touchSwipe.js(点击下载),
    下面就是主要代码分享
    1. $("#body").swipe( 
    2.            { 
    3.                swipe:function(event, direction, distance, duration, fingerCount) { 
    4.                    if(direction == "left"){ 
    5.                        alert("向左滑动了"); 
    6.                    }else if(direction == "right"){ 
    7.                        alert("向右滑动了"); 
    8.                    }else if(direction == "up"){ 
    9.                     alert("向上滑动了"); 
    10.                    }else if(direction == "down"
    11.                    { 
    12.                     alert("向下滑动了"); 
    13.                     } 
    14.                } 
    15.            } 
    16.        ); 

     

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-69-2257-1.html
    相关热词搜索: