17 Star 64 Fork 15

封尘/Sition

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.html 2.68 KB
一键复制 编辑 原始数据 按行查看 历史
封尘 提交于 2020-06-18 18:52 . 更新了变量名,防止冲突
<!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 src="src/sition.min.js?v=0.2" type="text/javascript" ></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>
<div id="demo"></div>
</body>
<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);
alert('向下滑动-左边')
});
Sition('demo','upRight',function(ev){
console.log(ev);
alert('向上滑动-右边')
});
Sition('demo','downRight',function(ev){
console.log(ev);
alert('向下滑动-右边')
});
Sition('demo','rightCenter',function(ev){
console.log(ev);
alert('向右滑动-居中')
});
Sition('demo','leftCenter',function(ev){
console.log(ev);
alert('向左滑动-居中')
});
Sition('demo','upCenter',function(ev){
console.log(ev);
alert('向上滑动-居中')
});
Sition('demo','downCenter',function(ev){
console.log(ev);
alert('向下滑动-居中')
});
Sition('demo','upLeftIng',function(ev){
console.log('向上滑动-右边-ing')
});
Sition('demo','downLeftIng',function(ev){
console.log('向下滑动-左边-ing')
});
Sition('demo','down',function(ev){
console.log(ev);
alert('向下滑动')
});
Sition('demo','up',function(ev){
console.log(ev);
alert('向上滑动')
});
Sition('demo','left',function(ev){
console.log(ev);
alert('向左滑动')
});
Sition('demo','right',function(ev){
console.log(ev);
alert('向右滑动')
});
Sition('demo','long',function(){
alert('长按操作')
});
Sition('demo','clicked',function(){
alert('双击操作')
});
</script>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lovefc/Sition.git
git@gitee.com:lovefc/Sition.git
lovefc
Sition
Sition
master

搜索帮助