May 19, 2021 WeChat Mini Program Development Document
Base library 1.4.0 starts to support, and low versions need to be compatible
Scroll the page to the destination.
Property | Type | The default | Required | Description | The lowest version |
scrollTop | number | Whether | Scroll to the target location of the page in px | ||
duration | number | 300 | Whether | The length of the scroll animation, in ms | |
selector | string | Whether | Selector | 2.7.3 | |
success | function | Whether | The interface calls a successful callback function | ||
fail | function | Whether | The interface calls the failed callback function | ||
complete | function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
Selector is similar to the CSS selector, but only supports the following syntax.
wx.pageScrollTo({
scrollTop: 0,
duration: 300
})