Skip to content

Commit

Permalink
docs: update docs and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonslyvia committed Apr 7, 2016
1 parent 4622eba commit 3a34b9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ Type: Bool Default: true

ONLY SET THIS TO `false` IF YOU SET `wheel` PROPS `true`.

### wheel
### overflow

Type: Bool Default: false

For overflow containers, scroll event not propagated to `window`, so you should use `wheel` props to make LazyLoad listen `wheel` event instead of `scroll`. Check [this demo](https://jasonslyvia.github.io/react-lazyload/examples/overflow.html) for detail.
If lazy loading components inside a overflow container, set this to `true`. Also make sure a `position` property other than `static` has been set to your overflow container.

### resize

Expand Down
2 changes: 2 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
counter-reset: widgets;
}
.widget-list.overflow {
position: relative;
height: 500px;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}
.widget {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion examples/pages/overflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class Overflow extends Component {
<div className="widget-list overflow">
{this.state.arr.map((el, index) => {
return (
<LazyLoad once={el.once} key={index} wheel={true} scroll={false}>
<LazyLoad once={el.once} key={index} overflow throttle={100}>
<Widget once={el.once} id={el.uniqueId} />
</LazyLoad>
);
Expand Down

0 comments on commit 3a34b9a

Please sign in to comment.