微信小程序——悬浮窗拖动
作者:互联网
使用
movable-area
movable-view
官方文档
代码
direction="all"属性必不可缺
wxml
<movable-area class="all">
<movable-view direction="all" class="touchmove">
<!-- <image src='../images/icon_component_HL.png'></image> -->
123223
</movable-view>
</movable-area>
wxss
.all{
pointer-events: none;
height: 90%;
width: 100%;
position: fixed;
left: 0px;
top: 10%;
background: rgba(173, 216, 230, 0.664);
}
.touchmove{
pointer-events: auto;
height: 50px;
width: 50px;
background: pink;
border-radius: 50%;
transform: translateX(91px) translateY(242.6px) translateZ(0px) scale(1);
transform-origin: center center;
will-change: auto;
}
标签:width,拖动,微信,50px,transform,height,悬浮,pointer,events 来源: https://blog.csdn.net/Willow_Spring/article/details/122822040