An open API service indexing awesome lists of open source software.

https://github.com/shenfe/lite-swiper

👆A lightweight swiper component for mobile frontend.
https://github.com/shenfe/lite-swiper

ui-component

Last synced: over 1 year ago
JSON representation

👆A lightweight swiper component for mobile frontend.

Awesome Lists containing this project

README

          

# lite-swiper
A lightweight swiper component for mobile frontend.

## Demo
[Demo](http://shenfe.github.io/repos/lite-swiper/demo.html)

## Usage

```bash
npm install lite-swiper --save
```

### elements
Ensure a container with [`width`, `height`, `overflow`] styles, an item wrapper, and several items:

```html

.container {
width: 100%;
height: 200px;
overflow: hidden;
}



item1

item2

item3



```

### script
Create an instance like this:

```js
var Swipe = require('lite-swiper');
var $target = document.getElementById('my-swiper');
var mySwiper = new Swipe($target, {
cssText: {
item: '',
indicators: '',
indicator: '',
indicatorCurrent: ''
},
onmoved: function (index, indexBefore) {
console.log(`moved from ${indexBefore} to ${index}`);
}
});
```
## License
MIT