最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序?qū)崿F(xiàn)錨點(diǎn)定位樓層跳躍的實(shí)例

 更新時(shí)間:2017年05月18日 14:21:09   作者:Rolan  
這篇文章主要介紹了微信小程序?qū)崿F(xiàn)錨點(diǎn)定位樓層跳躍的實(shí)例的相關(guān)資料,需要的朋友可以參考下

微信小程序?qū)崿F(xiàn)樓層錨點(diǎn)跳躍,點(diǎn)擊不同的錨點(diǎn)進(jìn)行位置跳躍:

利用:scroll-into-view 來實(shí)現(xiàn)

效果圖如下:

WXML:

<scroll-view class="content" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true"> 
 <view wx:for="{{act_addList}}"> 
  <view class="address_top" id="{{ 'inToView'+item.id}}">{{item.region}}</view> 
  <view wx:for="{{item.city}}"> 
   <view class="address_bottom">{{item.name}}</view> 
  </view> 
 </view> 
</scroll-view> 
<view class="orientation_region"> 
 <view class="orientation">自動(dòng)定位</view> 
 <block wx:for="{{orientationList}}" > 
  <view class="orientation_city" bindtap="scrollToViewFn" data-id="{{item.id}}">{{item.region}}</view> 
 </block> 
</view>  

WXSS:

page{ height: 100%;} 
.content{padding-bottom: 20rpx; box-sizing: border-box; height: 100%;} 
.location{width: 100%;} 
.location_top{height: 76rpx;line-height: 76rpx; background: #f4f4f4;color: #606660;font-size: 28rpx;padding: 0 20rpx;} 
.location_bottom{height: 140rpx;line-height: 140rpx;color: #d91f16;font-size: 28rpx;border-top: 2rpx #ebebeb solid; border-bottom: 2rpx #ebebeb solid;padding: 0 20rpx; align-items: center;display: -webkit-flex;} 
.address_top{height: 76rpx;line-height: 76rpx; background: #f4f4f4;color: #999999;font-size: 28rpx;padding: 0 20rpx;} 
.address_bottom{height: 88rpx;line-height: 88rpx; background: #fff;color: #000000;font-size: 32rpx;padding: 0 20rpx; border-bottom: 2rpx #ebebeb solid;margin-left: 20rpx;margin-right: 50rpx; } 
.location_img{width: 48rpx;height: 48rpx;position: absolute;right: 20rpx;top: 125rpx;} 
.add_city{width: 228rpx;height: 60rpx;line-height: 60rpx; text-align: center; border: 2rpx solid #ebebeb; color: #000000;margin-right: 20rpx; } 
.add_citying{width: 228rpx;height: 60rpx;line-height: 60rpx; text-align: center; border: 2rpx solid #09bb07; color: #09bb07;margin-right: 20rpx;} 
.orientation{white-space:normal;display: inline-block; width: 55rpx;height:58rpx; color: #999; text-align: center;} 
.orientation_region{ width: 55rpx;font-size: 20rpx;position: fixed;top: 220rpx; right: 0rpx;} 
.orientation_city{height: 50rpx; line-height: 50rpx;color: #000;text-align: center;} 

JS:

Page({ 
 /** 
  * 頁面的初始數(shù)據(jù) 
  */ 
 data: { 
  orientationList: [ 
   { id: "01", region: "東北" }, 
   { id: "02", region: "華北" }, 
   { id: "03", region: "華東" }, 
   { id: "04", region: "華南" }, 
   { id: "05", region: "華中" }, 
   { id: "06", region: "西北" }, 
   { id: "07", region: "西南" } 
  ], 
  act_addList: [ 
   { 
    id: "01", region: "東北地區(qū)", 
    city: [{ id: "0101", name: "白山江源" }, 
    { id: "0102", name: "白山市" }, 
    { id: "0103", name: "賓縣" }, 
    { id: "0104", name: "大慶" }, 
    { id: "0105", name: "測試1" }, 
    { id: "0106", name: "測試2" }, 
    { id: "0107", name: "測試3" }, 
    { id: "0108", name: "測試4" }, 
    { id: "0109", name: "測試5" }, 
    { id: "0110", name: "測試6" }, 
    ] 
   }, 
   { 
    id: "02", region: "華北地區(qū)", 
    city: [{ id: "0201", name: "包頭" }, 
    { id: "0202", name: "保定" }, 
    { id: "0206", name: "測試2" }, 
    { id: "0207", name: "測試3" }, 
    { id: "0208", name: "測試4" }, 
    { id: "0209", name: "測試5" }, 
    { id: "0210", name: "測試6" }, 
    ] 
   }, 
   { 
    id: "03", region: "華東地區(qū)", 
    city: [{ id: "0303", name: "開封市" }, 
    { id: "3104", name: "安陽市" },] 
   }, 
   { 
    id: "04", region: "華南地區(qū)", 
    city: [ 
     { id: "0401", name: "黑龍江市" }, 
     { id: "0407", name: "測試3" }, 
     { id: "0508", name: "測試4" }, 
     { id: "0609", name: "測試5" }, 
     { id: "0710", name: "測試6" }, 
     { id: "0711", name: "測試8" }, 
     { id: "0712", name: "測試9" }, 
     { id: "0713", name: "測試10" }, 
     { id: "0714", name: "測試11" }, 
    ] 
   }, 
   { id: "05", region: "華中地區(qū)", city: [{ id: "0501", name: "黑龍江市" }] }, 
   { 
    id: "06", region: "西北地區(qū)", 
    city: [{ id: "0603", name: "開封市" }, 
    { id: "0604", name: "安陽市" },] 
   }, 
   { 
    id: "07", region: "西南地區(qū)", 
    city: [{ id: "0703", name: "開封市" }, 
    { id: "0704", name: "安陽市" }, 
    { id: "0401", name: "黑龍江市" }, 
    { id: "0407", name: "測試3" }, 
    { id: "0508", name: "測試4" }, 
    { id: "0609", name: "測試5" }, 
    { id: "0710", name: "測試6" }, 
    { id: "0711", name: "測試8" }, 
    { id: "0712", name: "測試9" }, 
    { id: "0713", name: "測試10" }, 
    { id: "0714", name: "測試11" }, 
    { id: "0401", name: "黑龍江市" }, 
    { id: "0407", name: "測試3" }, 
    { id: "0508", name: "測試4" }, 
    { id: "0609", name: "測試5" }, 
    { id: "0710", name: "測試6" }, 
    { id: "0711", name: "測試8" }, 
    { id: "0712", name: "測試9" }, 
    { id: "0713", name: "測試10" }, 
    { id: "0714", name: "測試11" }, 
    ] 
   }, 
  ], 
  toView: 'inToView01', 
 }, 
 scrollToViewFn: function (e) { 
  var _id = e.target.dataset.id; 
  this.setData({ 
   toView: 'inToView' + _id 
  }) 
  console.log(this.data.toView) 
 }, 
 onLoad: function (options) { 
 } 
}) 

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

  • WebAssembly使用方法研究

    WebAssembly使用方法研究

    這篇文章主要為大家介紹了WebAssembly使用方法研究,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-08-08
  • 微信小程序 es6-promise.js封裝請(qǐng)求與處理異步進(jìn)程

    微信小程序 es6-promise.js封裝請(qǐng)求與處理異步進(jìn)程

    這篇文章主要介紹了微信小程序 es6-promise.js封裝請(qǐng)求與處理異步進(jìn)程的相關(guān)資料,需要的朋友可以參考下
    2017-06-06
  • 詳解Three.js?場景中如何徹底刪除模型和性能優(yōu)化

    詳解Three.js?場景中如何徹底刪除模型和性能優(yōu)化

    這篇文章主要為大家介紹了詳解Three.js?場景中如何徹底刪除模型和性能優(yōu)化,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-04-04
  • 羊了個(gè)羊的中強(qiáng)大的Grid布局

    羊了個(gè)羊的中強(qiáng)大的Grid布局

    這篇文章主要為大家介紹了羊了個(gè)羊的中強(qiáng)大的Grid布局詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-09-09
  • 微信小程序 登錄實(shí)例詳解

    微信小程序 登錄實(shí)例詳解

    這篇文章主要介紹了微信小程序 登錄實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下
    2017-01-01
  • 關(guān)于JavaScript?中?if包含逗號(hào)表達(dá)式

    關(guān)于JavaScript?中?if包含逗號(hào)表達(dá)式

    這篇文章主要介紹了?關(guān)于JavaScript?中?if包含逗號(hào)表達(dá)式,有時(shí)會(huì)看到JavaScript中if判斷里包含英文逗號(hào)?“,”,這個(gè)是其實(shí)是逗號(hào)表達(dá)式。在if條件里,只有最后一個(gè)表達(dá)式起判斷作用。下面來看看文章的具體介紹吧
    2021-11-11
  • Rxjs監(jiān)聽精確使用版本上線

    Rxjs監(jiān)聽精確使用版本上線

    這篇文章主要為大家介紹了Rxjs監(jiān)聽使用不精確版本上線晚3小時(shí),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-08-08
  • js前端架構(gòu)Git?commit提交規(guī)范

    js前端架構(gòu)Git?commit提交規(guī)范

    這篇文章主要為大家介紹了前端架構(gòu)Git?commit提交規(guī)范示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-07-07
  • 微信小程序(十一)icon組件詳細(xì)介紹

    微信小程序(十一)icon組件詳細(xì)介紹

    這篇文章主要介紹了微信小程序icon組件詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下
    2016-09-09
  • 插件導(dǎo)致ECharts被全量引入的坑示例解析

    插件導(dǎo)致ECharts被全量引入的坑示例解析

    這篇文章主要為大家介紹了插件導(dǎo)致ECharts被全量引入的坑示例解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-09-09

最新評(píng)論

武定县| 广河县| 富阳市| 忻州市| 贡觉县| 将乐县| 师宗县| 左云县| 芒康县| 疏勒县| 瑞安市| 阜宁县| 泗洪县| 安顺市| 巴林右旗| 尉犁县| 汶川县| 靖州| 台中市| 临猗县| 凉山| 呈贡县| 岗巴县| 德阳市| 苍山县| 通化县| 永寿县| 阳信县| 朝阳县| 刚察县| 高唐县| 乐昌市| 宁蒗| 辽阳市| 天峨县| 东乌珠穆沁旗| 营山县| 大荔县| 拉萨市| 丰城市| 应城市|