固定在窗口悬浮加动画

CSS部分

.big_box2-2{

  width: 150rpx;

  height: 200rpx;

  background-color: #ffff00;

  position: fixed;

  z-index: 999;

  right: 0rpx;

  top: 550rpx;

}

.redcard{

  width: 150rpx;

  height: 150rpx;

  margin-top: 50rpx;

  background-color: #f9e3b8;

  border-radius: 20rpx;

  animation:turn 1s linear infinite;

}

.redcard image{

  width: 100%;

  height: 100%;

}

@keyframes turn{

  0%{-webkit-transform:rotate(0deg);}

  25%{-webkit-transform:rotate(-10deg);}

  50%{-webkit-transform:rotate(-20deg);}

  75%{-webkit-transform:rotate(-10deg);}

  100%{-webkit-transform:rotate(0deg);}

}

 

HTML部分

<view class="big_box2-2">

    <view class="redcard" bindtap="activityCenter">

      <image src="../../images/icon/redcard.png"></image>

    </view>

  </view>

 

 

 

 

posted @ 2021-12-02 15:17  宅女二二  阅读(30)  评论(0)    收藏  举报