File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change 1
1
react-scroll-components
2
2
=======================
3
3
4
- A set of components that react to page scrolling
4
+ A set of components and mixins that react to page scrolling
5
+
6
+ ## ScrollListenerMixin
7
+
8
+ This mixin provides the following states:
9
+ * ` scrollTop ` , which represents the documents' current scroll position
10
+ * ` isScrolling ` , wether the user is currently scrolling the document
11
+
12
+ You can pass the following methods to your React class:
13
+ * ` onPageScroll ` : fired when the document is scrolling. This function gets the
14
+ current scroll position passed as argument.
15
+ * ` onPageScrollEnd ` : fired when the document's scroll position hasn't changed for
16
+ 300 milliseconds. This function also gets the current scroll position passed as
17
+ argument. If you want to change the timeout, override your components'
18
+ ` endScrollTimeout `
19
+
20
+ ## ScrollBlocker
21
+
22
+ A very simple component that allows you to block any mouse events during
23
+ scrolling. Make sure to include ScrollBlocker.css somewhere in your CSS.
24
+
25
+ ## Example
26
+
27
+ ``` javascript
28
+ var MyComponent = React .createClass ({
29
+ mixins: [ScrollListenerMixin],
30
+ render : function () {
31
+ return (
32
+ < ScrollBlocker active= {this .state .isScrolling }>
33
+ The current scroll position is {this .state .scrollTop }.< br / >
34
+ The document is currently {this .state .isScrolling ? ' ' : ' not' } scrolling.
35
+ < / ScrollBlocker>
36
+ )
37
+ }
38
+ })
39
+ ```
You can’t perform that action at this time.
0 commit comments