在开发中,有时会遇到像App中的手势那样的效果,下面就仿照App实现了一下。
wxml部分:
<view class="touch-container">
<view class="msg">{
{msg}}</view>
<image
class="img"
src="{
{src}}"
style="width: {
{width}}rpx; height: {
{height}}rpx; left: {
{left}}rpx; top: {
{top}}rpx; transform: translate(-50%, -50%) scale({
{ scale }}) rotate({
{ rotate }}deg);"
bindload="bindload"
catchtouchstart="touchstart"
catchtouchmove="touchmove"
catchtouchend="touchend"
></image>
</view>
wxss部分:
page {
width: 100%;
height: 100%;
background: #ffffff;
}
.touch-container {
width: 100%;
height: 100%;
padding-top: 0.1px;
}
.msg {
width: 100%;
height: 60rpx;