😍
Framer API 中文版
  • 写在前面
  • 从这里开始
    • 介绍
      • 快速开始
      • 基础
    • 教程
      • 准备 Setup
      • 引入 Slider 组件
      • Slider组件的元素
      • 拖动 & MotionValue
      • Hooks & 传递数据
      • 完成
      • 回顾
    • 简要案例
      • Frame
      • Stack
      • Animate
      • Gestures
      • Dragging 拖拽
      • Scrolling 滚动
      • Paging 翻页
      • Tranforms 变换
      • Variants 动画状态组
  • LIBRARY 库
    • Frame
      • Layout 布局
      • Visual 视觉
      • Transform 变换
      • Animation 动画
      • Transition 过渡
      • Variants 动画状态组
      • Tap 点击
      • Hover 悬浮
      • Pan
      • Drag
      • Types
    • Animation
      • Overview
      • Animation controls
      • Tween
      • Spring
      • Inertia 惯性
      • Orchestration
      • Types
    • Color
      • Create
      • Modify
      • Convert
      • Compare
      • Models
    • Page
      • Content
      • Padding
      • Events
      • Effects
      • PageEffectInfo
    • Scroll
      • Sizing
      • Content
      • Events
    • Stack
      • Content
      • Padding
    • Utilities
      • Transfrom
      • useTransform
      • useAnimation
      • useCycle
      • useMotionValue
      • useSpring
      • useViewportScroll
  • FRAMER X
    • Assets
      • Functions
    • Data & Overrides
    • CanvasComponents
      • Canvas.tsx
      • Layout
      • Colors
    • PropertyControls
      • Adding Controls
      • Hiding Controls
      • Array
      • Boolean
      • Color
      • ComponentInstance
      • Enum
      • File
      • FusedNumber
      • Image
      • Number
      • SegmentedEnum
      • String
    • Render Target
      • Properties
      • Functions
Powered by GitBook
On this page

Was this helpful?

  1. LIBRARY 库
  2. Scroll

Events

onScroll(info): void

当滚动时周期性地调用该事件绑定的函数

function onScroll(info) {
  console.log(info.offset, info.velocity)
}

<Scroll onScroll={onScroll} />

info: PanInfo

这个对象包含了各种x和y的信息:

- point: 相对于设备或者页面的位置信息

- delta:和上一次事件触发时的距离

- offset: 与刚开始滚动时鼠标或者手指位置相比的偏移量

- velocity: 当前指针的速度

onScrollStart(info): void

开始滚动时触发绑定的函数

function onScrollStart(info) {
  console.log(info.offset, info.velocity)
}

<Scroll onScrollStart={onScrollStart} />

info: PanInfo

这个对象包含了各种x和y的信息:

- point: 相对于设备或者页面的位置信息

- delta:和上一次事件触发时的距离

- offset: 与刚开始滚动时鼠标或者手指位置相比的偏移量

- velocity: 当前指针的速度

onScrolEnd(info): void

开始结束时触发绑定的函数

function onScrollEndStart(info) {
  console.log(info.offset, info.velocity)
}

<Scroll onScrollEnd={onScrollEnd} />

info: PanInfo

这个对象包含了各种x和y的信息:

- point: 相对于设备或者页面的位置信息

- delta:和上一次事件触发时的距离

- offset: 与刚开始滚动时鼠标或者手指位置相比的偏移量

- velocity: 当前指针的速度

PreviousContentNextStack

Last updated 5 years ago

Was this helpful?