mirror of
https://github.com/webslides/WebSlides.git
synced 2025-09-02 09:33:25 +02:00
Updated Core API (markdown)
@@ -27,9 +27,10 @@ WebSlides constructor accepts an object with options.
|
|||||||
| `changeOnClick` | `boolean` | `false` | If true, clicking on the page will go to the next slide unless it's a clickable element. See [ClickToNav docs](./click-to-nav.md) for more info. |
|
| `changeOnClick` | `boolean` | `false` | If true, clicking on the page will go to the next slide unless it's a clickable element. See [ClickToNav docs](./click-to-nav.md) for more info. |
|
||||||
| `loop` | `boolean` | `true` | Lets WebSlides loop the slides so once it reaches the end, going next will make it go to the first slide. |
|
| `loop` | `boolean` | `true` | Lets WebSlides loop the slides so once it reaches the end, going next will make it go to the first slide. |
|
||||||
| `minWheelDelta` | `number` | `40` | Controls the amount of scroll needed to trigger a navigation. Lower this number to decrease the scroll resistance. |
|
| `minWheelDelta` | `number` | `40` | Controls the amount of scroll needed to trigger a navigation. Lower this number to decrease the scroll resistance. |
|
||||||
|
| `navigateOnScroll` | `number` | `40` | Whether scroll can trigger navigation or not. |
|
||||||
| `scrollWait` | `number` | `450` | Controls the amount of time needed to wait for a scroll transition to happen again. |
|
| `scrollWait` | `number` | `450` | Controls the amount of time needed to wait for a scroll transition to happen again. |
|
||||||
| `slideOffset` | `number` | `50` | Amount of sliding needed to trigger a new navigation. |
|
| `slideOffset` | `number` | `50` | Amount of sliding needed to trigger a new navigation. |
|
||||||
|
| `showIndex` | `boolean` | `true` | Controls if the index can be shown. |
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const ws = new WebSlides({
|
const ws = new WebSlides({
|
||||||
@@ -37,8 +38,10 @@ const ws = new WebSlides({
|
|||||||
changeOnClick = false,
|
changeOnClick = false,
|
||||||
loop = true,
|
loop = true,
|
||||||
minWheelDelta = 40,
|
minWheelDelta = 40,
|
||||||
|
navigateOnScroll = true,
|
||||||
scrollWait = 450,
|
scrollWait = 450,
|
||||||
slideOffset = 50
|
slideOffset = 50,
|
||||||
|
showIndex = true
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user