小程序 自定义气泡框

// wxml 
<image catchtap="eduBulletFrame" src="/images/question.png"></image>

<view class="s_explanation" wx:if="{{ifBulletFrame}}" catchtap="eduBulletFrame">满2001减1000满2001减1000满2001减1000满2001减1000满2001减1000满2001减1000满2001减1000满2001减1000满2001减1000</view>
// js
ifBulletFrame:false,
eduBulletFrame(e) {
    let ifBulletFrame = this.data.ifBulletFrame   //控制显示的参数
    this.setData({
      ifBulletFrame: !ifBulletFrame,
    })
  },

// css

.s_explanation {
  font-size: 26rpx;
  max-width: 252rpx;
  color: #333333;
  padding: 20rpx 40rpx;
  background: #ffffff;
  position: absolute;
  top: -40rpx;
  left:330rpx;
  border-radius: 12rpx;
  z-index: 10;
  box-shadow:2rpx 2rpx 8rpx 8rpx #E4E4E4;

}
.s_explanation:before{
  position: absolute;
  top: 60rpx;
  left: -10rpx;
  content: '';
  width: 20rpx;
  height: 20rpx;
  background: #ffffff;
  transform: rotate(135deg);
  box-shadow:0rpx 0rpx 8rpx 8rpx #E4E4E4;
}
.s_explanation:after{
  position: absolute;
  top: 45rpx;
  left: 0rpx;
  content: '';
  width: 35rpx;
  height: 60rpx;
  background: #fff;
}

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值