这篇文章主要介绍了Javascript监听触摸事件代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
监听
Wsscat滑动事件Demo
上下左右滑动
* {
margin: 0;
padding: 0;
}
article {
background-color: #000000;
width: 100%;
height: 100px;
text-align: center;
line-height: 100px;
color: #FFFFFF;
}
触摸
body {
width: 100%;
overflow: hidden;
}
.page {
width: 100%;
height: 100%;
position: absolute;
font-size: 100px;
text-align: center;
}
.page .wrap {
height: 500px;
}
.page-1-1 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-2-1 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-2-2 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-3-1 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-3-2 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-4-1 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-4-2 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-5-1 {
background-image: url(img/background/1.png);
background-size: cover;
}
.page-current {
z-index: 1;
}
.hide {
display: none;
}
.pt-page-moveToTop {
-webkit-animation: moveToTop .6s ease both;
animation: moveToTop .6s ease both;
}
@-webkit-keyframes moveToTop {
from {}
to {
-webkit-transform: translateY(-100%);
}
}
.pt-page-moveFromBottom {
-webkit-animation: moveFromBottom .6s ease both;
animation: moveFromBottom .6s ease both;
}
@-webkit-keyframes moveFromBottom {
from {
-webkit-transform: translateY(100%);
}
}
.pt-page-moveToBottom {
-webkit-animation: moveToBottom .6s ease both;
animation: moveToBottom .6s ease both;
}
@-webkit-keyframes moveToBottom {
from {}
to {
-webkit-transform: translateY(100%);
}
}
.pt-page-moveFromTop {
-webkit-animation: moveFromTop .6s ease both;
animation: moveFromTop .6s ease both;
}
@-webkit-keyframes moveFromTop {
from {
-webkit-transform: translateY(-100%);
}
}
.pt-page-moveToRight {
-webkit-animation: moveToRight .6s ease both;
animation: moveToRight .6s ease both;
}
@-webkit-keyframes moveToRight {
from {}
to {
-webkit-transform: translateX(100%);
}
}
.pt-page-moveToLeft {
-webkit-animation: moveToLeft .6s ease both;
animation: moveToLeft .6s ease both;
}
@-webkit-keyframes moveToLeft {
from {}
to {
-webkit-transform: translateX(-100%);
}
}
触摸前后
GitHub地址:https://github.com/lianglixiong
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



