0.3.2 • Published 8 years ago
mw-carousel v0.3.2
mw-carousel
mw-carousel based on . So the basic usage will be similar.
Demo
Check out the demo from a mobile device (real or emulated).
Install
npm install mw-carouselUsage
Example
import React from 'react'
import ReactDOM from 'react-dom';
import ReactSwipe from 'mw-carousel';
class Carousel extends React.Component {
render() {
return (
<ReactSwipe className="carousel" swipeOptions={{continuous: false}}>
<div>PANE 1</div>
<div>PANE 2</div>
<div>PANE 3</div>
</ReactSwipe>
);
}
}
ReactDOM.render(
<Carousel />,
document.getElementById('app')
);Props
swipeOptions: ?Object- supports all original options fromstyle: ?Object- object with 3 keys (see defaults):container: ?Objectwrapper: ?Objectchild: ?Object
- regular props as
className,idfor root component are also supported
| property name(字段名称) | 类型 | default(默认值) |
|---|---|---|
| swipeOptions.startSlide | PropTypes.number | 0 |
| swipeOptions.speed | PropTypes.number | 300(ms) |
| swipeOptions.auto | PropTypes.number | 3000(ms),停顿时间 |
| swipeOptions.continuous | PropTypes.bool | false, 是否循环播放 |
| swipeOptions.disableScroll | PropTypes.bool | true, 禁止滚动 |
| swipeOptions.stopPropagation | PropTypes.bool | true |
| swipeOptions.callback | PropTypes.func | (index, slide) => {...} index: 序号;slide: 当前element |
| id | PropTypes.string | id |
| className | PropTypes.string | classname |
| style.container | PropTypes.object | {height: '300px'}... |
| style.wrapper | PropTypes.object | {height: '300px'}... |
| style.child | PropTypes.object | {height: '300px'}... |
Methods
Component proxies all Swipe.js instance methods.
<ReactSwipe>
{images}
</ReactSwipe>MIT Licensed
0.3.2
8 years ago
0.3.1
8 years ago
0.3.0
8 years ago
0.2.9
8 years ago
0.2.8
8 years ago
0.2.7
8 years ago
0.2.6
8 years ago
0.2.5
8 years ago
0.2.4
8 years ago
0.2.3
8 years ago
0.2.2
8 years ago
0.2.1
8 years ago
0.2.0
8 years ago
0.1.9
8 years ago
0.1.8
8 years ago
0.1.7
8 years ago
0.1.6
8 years ago
0.1.5
8 years ago
0.1.4
8 years ago
0.1.3
8 years ago
0.1.2
8 years ago
0.1.1
8 years ago
0.1.0
8 years ago