# css-transition-slide

> css-transition-slide

Latest version **1.2.0** (published 2017-01-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install css-transition-slide
pnpm add css-transition-slide
yarn add css-transition-slide
bun add css-transition-slide
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-01-17 |
| First published | 2017-01-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yangjunhua |
| Maintainers | yangjunhua |
| Keywords | slide, switch, swipe |

## Links

- npm: https://www.npmjs.com/package/css-transition-slide
- Repository: https://github.com/yjh30/css-transition-slide
- Homepage: https://github.com/yjh30/css-transition-slide#readme
- Issues: https://github.com/yjh30/css-transition-slide/issues
- npm.io page: https://npm.io/package/css-transition-slide

## Dependencies (1)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.20.0

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 1.2.0 (latest) — 2017-01-17
- 1.1.2 — 2017-01-13
- 1.1.1 — 2017-01-13
- 1.1.0 — 2017-01-12
- 1.0.0 — 2017-01-11

## README

### Installation
```
npm install css-transition-slide --save
```

### Usage
```javascript
var Slide = require('css-transition-slide');
var slide = new Slide(options);
```

- **options**
  - **el** 挂载元素
  - **duration** 轮播动画时间，默认400ms
  - **delay** 开始轮播延迟时间，默认4000ms
  - **interval** 轮播间隔时间，默认4000ms
  - **auto** 自动轮播，默认false
  - **loop** 支持循环轮播，默认true
  - **slideStart** 轮播之前开始执行的函数
  - **slideEnd** 轮播之后开始执行的函数

---

- **methods**
  - **prev()** 滑动到上一屏
  - **next()** 滑动到下一屏
  - **slideTo(index)** 滑动到指定屏，index从1开始


### Example
```html
<div class="slide-component">
    <div class="slide-items flex-row-box">
        <div class="slide-item">第一屏</div>
        <div class="slide-item">第二屏</div>
        <div class="slide-item">第三屏</div>
        <div class="slide-item">第四屏</div>
    </div>
</div>
```

```javascript
var Slide = require('css-transition-slide');
var slide = new Slide({
    el: document.querySelector('.slide-component'),
    auto: true
});

// console.log(slide.slide.index); // 当前屏索引，从1开始
// console.log(slide.slide.length); // 屏数
```

---
_Source: https://npm.io/package/css-transition-slide · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
