Skip to content

横向滑动 v1.1.0

方法名

slideHorizontal

用法

  • 用法如下:
    js
    module.slideHorizontal({
      //起始X相对屏幕百分比,取值范围[0, 1]
      xStartPercent: 0.8,
      //起点Y相对屏幕百分比,取值范围[0, 1]
      yPercent: 0.5,
      //终点X相对屏幕百分比,取值范围[0, 1]
      xEndPercent: 0.2,
      //滑动时长,单位:毫秒
      duration: 500
    }, res => {})
  • 参数说明
    参数名参数类型是否必填默认值参数描述
    xStartPercentfloat起始X相对屏幕百分比,取值范围[0, 1],0.5为屏幕中间
    yPercentInteger起点Y相对屏幕百分比,取值范围[0, 1]
    xEndPercentInteger终点X相对屏幕百分比,取值范围[0, 1]
    durationInteger滑动时长,单位:毫秒

回调

  • 示例
    json
    {
      "data": {},
      "message": "",
      "code": 0
    }
  • 回调说明:
    参数名参数类型参数描述
    messageString消息提示
    dataObject数据对象
    codeInteger返回类型,0.成功,其他:失败