tencent cloud

Feedback

Last updated: 2024-07-12 19:33:49

    pageScrollTo

    This API is used via wx.pageScrollTo(Object object).
    Feature Description: Scrolls the page to the desired location.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    scrollTop
    number
    -
    Yes
    Scroll to the target position on the page, measured in pixels.
    duration
    number
    300
    No
    Duration of the scrolling animation, measured in milliseconds.
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    Sample Code
    wx.pageScrollTo({
    scrollTop: 0,
    duration: 300
    })

    ScrollViewContext

    Feature Description: Enhances ScrollView instance, which can be obtained through the wx.createSelectorQuery's NodesRef.node method. Effective only when the scroll-view component's enhanced attribute is enabled.
    Attribute and Descriptions
    Attribute
    Type
    Description
    scrollEnabled
    boolean
    Scrolling Switch
    bounces
    boolean
    Set the scroll boundary elasticity (currently unsupported)
    showScrollbar
    boolean
    Set the visibility of the scrollbar
    pagingEnabled
    boolean
    Pagination Slide Switch
    fastDeceleration
    boolean
    Set scroll deceleration rate (iOS only)
    decelerationDisabled
    boolean
    Cancel the scroll inertia (Effective only on iOS)
    Sample Code
    wx.createSelectorQuery()
    .select('#scrollview')
    .node()
    .exec((res) => {
    const scrollView = res[0].node;
    scrollView.scrollEnabled = false;
    })

    .scrollIntoView

    The method is used via: ScrollViewContext.scrollIntoView(string selector, object ScrollIntoViewOptions)
    Feature Description: Scrolls to the specified position.
    Parameters and Description: string selector, element selector.

    .scrollTo

    The method is used via ScrollViewContext.scrollTo(Object object)
    Feature Description: Scrolls to the specified position.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    top
    number
    -
    No
    Top distance
    left
    number
    -
    No
    Left Boundary Distance
    velocity
    number
    -
    No
    Initial Speed (iOS only)
    duration
    number
    -
    No
    Scroll animation length (iOS only)
    animated
    boolean
    -
    No
    Enable scroll animation or not
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support