sition手机端移动端左右滑动手势检测示例代码
代码语言:html
所属分类:拖放
代码描述:sition手机端移动端左右滑动手势检测示例代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Sition插件演示</title> <meta name="keywords" content="Sition插件演示" /> <meta name="description" content="Sition插件演示" /> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/sition.js"></script> <style> body{ max-width:300px; max-height:800px; margin:10px; } #demo{ margin-left:30px; margin-top:80px; max-width:500px; height:500px; background-color:#000; } </style> </head> <body> <h2>请在移动端手机端左右滑动试试</h2> <div id="demo"></div> <script> Sition('demo','leftUp',function(ev){ console.log(ev); alert('向左滑动-顶部') }); Sition('demo','rightUp',function(ev){ console.log(ev); alert('向右滑动-顶部') }); Sition('demo','leftUpIng',function(ev){ console.log('向左滑动-顶部-ing') }); Sition('demo','rightUpIng',function(ev){ console.log('向右滑动-顶部-ing') }); Sition('demo','leftDown',function(ev){ console.log(ev); alert('向左滑动-底部') }); Sition('demo','rightDown',function(ev){ console.log(ev); alert('向右滑动-底部') }); Sition('demo','upLeft',function(ev){ console.log(ev); alert('向上滑动-左边') }); Sition('demo','downLeft',function(ev){ console.log(ev); aler.........完整代码请登录后点击上方下载按钮下载查看
网友评论0