From 17cadbb3fad745b188028d23d1d0f88a879f6937 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Sat, 10 Sep 2016 12:45:33 +0800 Subject: [PATCH] docs: update docs of Affix --- components/affix/index.en-US.md | 8 ++++++++ components/affix/index.zh-CN.md | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/affix/index.en-US.md b/components/affix/index.en-US.md index 8cd7887a92..c9800ca676 100644 --- a/components/affix/index.en-US.md +++ b/components/affix/index.en-US.md @@ -19,3 +19,11 @@ Please note that Affix should not cover other content in page, especially when t | offsetTop | Pixels to offset from top when calculating position of scroll | Number | 0 | | offsetBottom | Pixels to offset from bottom when calculating position of scroll | Number | - | | onChange | Callback when affix state is changed | Function(affixed) | - | + +**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`: + +```jsx + + ... + +``` diff --git a/components/affix/index.zh-CN.md b/components/affix/index.zh-CN.md index bb4a4f54ab..20b3a71e3e 100644 --- a/components/affix/index.zh-CN.md +++ b/components/affix/index.zh-CN.md @@ -15,10 +15,17 @@ english: Affix ## API - | 成员 | 说明 | 类型 | 默认值 | |-------------|----------------|--------------------|--------------| | offsetTop | 距离窗口顶部达到指定偏移量后触发 | Number | | | offsetBottom | 距离窗口底部达到指定偏移量后触发 | Number | | | target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window | | onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 | + +**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位: + +```jsx + + ... + +```