微信小程式實現錨點定位樓層跳躍的例項

2022-10-08 06:00:12 字數 1060 閱讀 3587

微信小程式實現樓層錨點跳躍,點選不同的錨點進行位置跳躍:

利用:scroll-into-view 來實現

效果圖如下:

wxml: }

} 自動定位

} wxss:

page

.content

.location

.location_top

.location_bottom

.address_top

.address_bottom

.location_img

.add_city

.add_citying

.orientation

.orientation_region

.orientation_city

js:page(,

, ,

, ,

, ],

act_addlist: [

, ,

, ,

, ,

, ,

, ,

] },

, ,

, ,

, ,

, ]

}, ,

,] },

, ,

, ,

, ,

, ,

, ]

}, ] },

, ,]

}, ,

, ,

, ,

, ,

, ,

, ,

, ,

, ,

, ,

, ,

, ]

}, ],

toview: 'intoview01',

}, scrolltoviewfn: function (e) )

console.log(this.data.toview)

}, onload: function (options)

})本文標題: 微信小程式實現錨點定位樓層跳躍的例項

本文位址:

小程式實現錨點定位

在小程式中要實現錨點定位,需要使用到元件scroll view 需要用到的是scroll into view這條屬性,這條屬性的官網解釋是這樣的 scroll into viewstring 值應為某子元素id id不能以數字開頭 設定哪個方向可滾動,則在哪個方向滾動到該元素 於是乎,我們只需要給s...

微信小程式 手寫簽名 微信小程式實現電子簽名功能

x.wxml bindtouchmove canvasmove bindtouchend canvasend touchcancel canvasend binderror canvasiderrorcallback 上傳簽名 清除簽名 js var context null 使用 wx.creat...

詳解微信小程式 相對定位和絕對定位

詳解微信小程式 相對定位和絕對定www.cppcns.com位 相對定位 元素是相對自身進行定位,參照程式設計客棧物是自己。絕對定位 元素是相對離它最近的乙個已定位的父級元素進行定位 相對定位 n position relative 啟用相對定位 left 150rpx 相對於自己往右偏離150 t...