当前位置:网站首页>Applet: scroll to the top of the page or an element position
Applet: scroll to the top of the page or an element position
2022-06-10 06:57:00 【Front end life of Lvan】
background
We usually scroll to the top of the page 、 Bottom , Or the need to scroll to the location of an element , stay web We usually use scroll Related methods , For details, see js: Probably the most complete scroll Related methods , So in the applet , We usually use wx.pageScrollTo
API

practice
Scroll to top
wx.pageScrollTo({
scrollTop: 0
})
Scroll to element position
wx.pageScrollTo({
selector: '#my-dom'
})
Scroll to the bottom
wx.pageScrollTo({
// You can fill in a large number , You can also use element selectors to do
scrollTop: 10000
})
边栏推荐
- A brief introduction to the difference between static web pages and dynamic web pages webl Differences between 0 and Web2.0 brief introduction to the differences between get and post methods
- 刘勇智:一码通缺陷分析与架构设计方案丨声网开发者创业讲堂 Vol.02
- Cesium 1.91 update log - MSAA and native promise are coming
- Teleyecontroller v8.69 reconfiguration of keyboard recording function release by:yose
- Deploy MySQL based on statefulset in kubernetes (Part 1)
- OpenCV学习(二)---树莓派上安装opencv
- CMD of Jerry's AI protocol_ SET_ BLE_ Format of visibility command [chapter]
- Matlab: polynomial representation and its basic operations
- Jerry's aicmd_ SET_ BT_ Addr command format [chapter]
- leetcode.38 ---外观数列
猜你喜欢

How to solve mysql1045 and find the prompt is not an internal command

Qt--- create dialog box 3: implementation of shape variable dialog box

openGauss 数据库 ODBC 环境连接配置 (Windows)

Nignx configuring websocket

Yosezang original signature locator signaturetest v6.36 RLS release

Why can't lldb print view bounds? - Why can't LLDB print view. bounds?

Instagram CEO: "Apple iPad is not very popular, and it is not worth developing an exclusive version of the app"

Unity fully elastic collision

GO+VUE+PGSQL-家族管理系统项目结项

Where will the alarm messages go? Fly in the flying book
随机推荐
关于我并不是一个灰帽子的声明
618. How to prepare for the great promotion
Rsync+inotify remote synchronization
Unlock TRPC high performance password: introduction to network scheme!
Daily practice: Longest symmetric string (pay attention to the last two methods)
Around ifelse and business logic
Successfully solved: importerror: cannot import name 'import' from 'sklearn preprocessing
Summary of CUDA parallel computing optimization strategies
【动态规划】LeetCode1092. 最短公共超序列
Abnormal display of mobile signal at startup
pyinstaller
28. mobile terminal touch event
一本通1281.最长上升子序列 题解 动态规划
Teleyecontroller v8.7 repair Wan cable and add display delay function
You can have zongzi if you want, but you have to go through my authentication and authorization
微信团队分享:微信后台在海量并发请求下是如何做到不崩溃的
bson,json
Beyond compare
JS method to verify whether the content of the input box is empty
QT---创建对话框2:快速对话框设计