0
点赞
收藏
分享

微信扫一扫

微信小程序——悬浮窗拖动

m逆光生长 2022-02-08 阅读 64

在这里插入图片描述

使用
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;
}
举报

相关推荐

0 条评论