a-simple-carousel
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "a-simple-carousel", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Simple, performant, vanilla JS carousel implementation", | ||
@@ -5,0 +5,0 @@ "main": "src/js/index.js", |
@@ -36,7 +36,14 @@ # Simple Carousel | ||
Then import `SimpleCarousel` from that package: | ||
Next, you'll need to in some way include the CSS file into your build that is | ||
necessary for it to render right. You can *either* include the SASS file into | ||
your SASS build, found at `src/sass/SimpleCarousel.scss` (relative to the | ||
`SimpleCarousel` module), *or* you can just directly import the CSS file from | ||
`dist/css/SimpleCarousel.css` (again, relative to the module root). | ||
Once you have the CSS getting to the page, import `SimpleCarousel` from that | ||
package into your Javascript where needed: | ||
```javascript | ||
import * as SimpleCarousel from "a-simple-carousel"; | ||
``` | ||
import {SimpleCarousel} from "a-simple-carousel"; | ||
``` | ||
@@ -61,3 +68,3 @@ Then just follow the [Creating a Carousel](#creating-a-carousel) documentation | ||
``` | ||
```html | ||
<div id="my-carousel"> | ||
@@ -84,3 +91,3 @@ <div class="tray"> | ||
``` | ||
```javascript | ||
var carousel = SimpleCarousel.init({ | ||
@@ -93,3 +100,3 @@ element: document.getElementById("my-carousel") | ||
``` | ||
```javascript | ||
var carousel = new SimpleCarousel.Carousel({ | ||
@@ -113,3 +120,3 @@ selector: "#my-carousel" | ||
``` | ||
```javascript | ||
var carousel = SimpleCarousel.init({ | ||
@@ -130,3 +137,3 @@ element: document.getElementById("my-carousel") | ||
``` | ||
```javascript | ||
var carousel = SimpleCarousel.init({ | ||
@@ -151,3 +158,3 @@ element: document.getElementById("my-carousel") | ||
Required: Yes (if [Selector](#selector) option is not specified)<br /> | ||
Value: `HTMLElement` | ||
Value: `HTMLElement`<br /> | ||
Default: n/a<br /> | ||
@@ -162,3 +169,3 @@ Key: `element` | ||
Required: Yes (if [Element](#element) option is not specified)<br /> | ||
Value: `String` | ||
Value: `String`<br /> | ||
Default: n/a<br /> | ||
@@ -165,0 +172,0 @@ Key: `selector` |
@@ -15,3 +15,2 @@ export class Carousel { | ||
this.upgrade(); | ||
this.computeStatus(); | ||
} | ||
@@ -40,7 +39,7 @@ | ||
this.isMoving = false; | ||
} | ||
next() { | ||
this.computeStatus(); | ||
} | ||
next() { | ||
if(this.isAgainstRightWall) { | ||
@@ -56,2 +55,4 @@ return; | ||
previous() { | ||
this.computeStatus(); | ||
if(this.isAgainstLeftWall) { | ||
@@ -58,0 +59,0 @@ return; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13140
204