久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      小程序如何改變元素的樣式

      小程序如何改變元素的樣式

      1、獲取元素的樣式

      使用wx.createSelectorQuery()來獲取元素

      這里需要注意的是:獲取元素樣式的函數(shù)應(yīng)該放在onReady:function(){}這個里面

      let that = this const query = wx.createSelectorQuery() query.select('.detail-card').boundingClientRect() query.select('.detail-header').boundingClientRect() query.exec((res => {     that.setData({         cardHeight: res[0].height,         headerHeight: res[1].height     }) }))

      2、修改元素的樣式

      這里思路是WXML中元素的樣式利用style給一個變量,通過修改topList這個數(shù)組來修改top屬性

      <view      class="detail-card"      style="top:{{topList[index]+'px'}};z-index:{{index}}"      id="{{'card'+index}}"      wx:for="{{people}}"      wx:key="{{index}}"      catchtap="cardClick" > </view>

      PHP中文網(wǎng),大量免費小程序開發(fā)教程,歡迎學(xué)習(xí)!

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號