微信小程序:Swiper组件的小圆点的位置如何更改

1.swiper的小圆点没有直接的属性更改位置

2.写代码的过程中无意中发现,可以通过设置swiper的小圆点的高度,至于左右暂时没发现。

3.具体实现

(1)效果图

         

(2)index.wxml中的代码

 <!--首页banner轮播图-->
  <view class='banner_view'>
    <swiper class="swiper" 
    indicator-dots="{{indicatorDots}}"
    indicator-color='white' 
    indicator-active-color='#2C2D80'
    autoplay="{{autoplay}}" 
    interval="{{interval}}" 
    duration="{{duration}}" 
    current="{{swiperCurrent}}" 
    circular="{{circular}}">
    <block wx:for="{{imgUrls}}">
      <swiper-item>
        <image src="{{item}}" 
          class="slide-image" 
          width="750" 
          height="324"/>
      </swiper-item>
    </block>
    </swiper>
  </view>

(3)index.wxss中的代码,通过改变line-height的值来实现位置的变更。

/* banner样式 */
.banner_view {
  width: 100%;
  height: 386rpx;
  background-color: white;
  line-height: 50rpx;/* 可以改变swiper上小圆点的位置 */
  position: relative;
}
.swiper {
  width: 100%;
  height: 324rpx;
}

.slide-image {
  width: 100%;
  height: 100%;
}

 

  • 9
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值