pietile-carousel
Advanced tools
Comparing version 1.2.0 to 1.2.1
# Changelog | ||
## 1.2.1 | ||
- Handle case when children equal count | ||
## 1.2.0 | ||
@@ -4,0 +8,0 @@ |
@@ -166,3 +166,7 @@ "use strict"; | ||
var translate; | ||
if (index >= 0) { | ||
if (!tail) { | ||
startIndex = 0; | ||
translate = 0; | ||
} | ||
else if (index >= 0) { | ||
startIndex = (Math.floor(index / tail) * tail) % childrenCount; | ||
@@ -169,0 +173,0 @@ translate = frameWidth * (index % tail); |
{ | ||
"name": "pietile-carousel", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "React Carousel", | ||
"keywords": [ | ||
"react", | ||
"carousel" | ||
], | ||
"license": "MIT", | ||
@@ -6,0 +10,0 @@ "main": "dist/index.js", |
# Pietile Carousel | ||
[](https://bundlephobia.com/result?p=pietile-carousel@latest) | ||
React carousel which tries to minimize amount of repaints and be simple in use. | ||
@@ -13,6 +15,7 @@ | ||
- Сyclicality | ||
- Tiny (2.1kB gzipped) | ||
## Usage | ||
Every item is wrapped in container where it can layout it's content. The size of container depends on the size of carousel and amount of visible items. You can use any styling system you want to set styles. Get ref and user moveLeft/moveRight/moveTo methods for scroll. | ||
Every item is wrapped in container where it can layout it's content. The size of container depends on the size of carousel and amount of visible items. You can use any styling system you want to set styles. Get ref and use moveLeft/moveRight/moveTo methods for scroll. | ||
@@ -19,0 +22,0 @@ ## Example |
20
372
89
24993