😍
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

Content

dragEnabled: boolean

设置是否可以滚动,默认是true

<Scroll dragEnabled={false} />

wheelEnabled: boolean

设置是否可以滑轮滚动,默认是true

<Scroll wheelEnabled={false} />

direction:"horizontal" | "vertical" | "both" | "locked"

设置可滚动的方向。默认是垂直滚动即"vertical",如果设置"both"即水平和垂直方向都可滚动。

"locked" 是当你一开始滚动是往哪个方向,在未放开鼠标或者手指之前就只能一直在此方向滚动。

// Horizontal
<Scroll direction="horizontal" />

// Vertical
<Scroll direction="vertical" />

// Locked
<Scroll direction="locked" />

// Both directions
<Scroll direction="both" />

contentOffsetX: MotionValue<number> | number

组件初始状态下的Y轴滚动偏移量,默认是0。

<Scroll contentOffsetX={20} />

contentOffsetY: MotionValue<number> | number

组件初始状态下的X轴滚动偏移量,默认是0。

<Scroll contentOffsetY={20} />

scrollAnimate: FrameProps["animate"]

给滚动效果设置自定义的控制

const controls = useAnimation()
controls.start({ y: -50 })
<Scroll scrollAnimate={controls} />

PreviousSizingNextEvents

Last updated 5 years ago

Was this helpful?