mirror of
https://github.com/webslides/WebSlides.git
synced 2025-09-02 09:33:25 +02:00
Updated Core API (markdown)
@@ -69,7 +69,7 @@ Do you want to get your hands dirty? This is the API for the WebSlides module:
|
|||||||
Goes to a given slide.
|
Goes to a given slide.
|
||||||
|
|
||||||
| Param | Type | Description |
|
| Param | Type | Description |
|
||||||
| --- | --- | --- | --- |
|
| ----- | ---- | ----------- |
|
||||||
| slideIndex | <code>number</code> | The slide index. |
|
| slideIndex | <code>number</code> | The slide index. |
|
||||||
| forward | <code>boolean</code> | Whether we're forcing moving forward/backwards. This parameter is used only from the `goNext`, `goPrev` functions to adjust the scroll animations. |
|
| forward | <code>boolean</code> | Whether we're forcing moving forward/backwards. This parameter is used only from the `goNext`, `goPrev` functions to adjust the scroll animations. |
|
||||||
|
|
||||||
@@ -86,7 +86,8 @@ Goes to the previous slide. If the page is vertical, it will animate the scroll
|
|||||||
<a name="registerPlugin"></a>
|
<a name="registerPlugin"></a>
|
||||||
|
|
||||||
### `registerPlugin(key, cto)`
|
### `registerPlugin(key, cto)`
|
||||||
Registers a plugin to be loaded when the instance is created. It allows (on purpose) to replace default plugins.
|
|
||||||
|
Register a plugin to be loaded when the instance is created. It allows (on purpose) to replace default plugins.
|
||||||
|
|
||||||
Those being:
|
Those being:
|
||||||
|
|
||||||
@@ -110,7 +111,7 @@ You can [read more](Plugin-development) about plugin development.
|
|||||||
|
|
||||||
### Public properties
|
### Public properties
|
||||||
|
|
||||||
These properties are inside of the WebSlides instance and they could be useful to achieve new behaviours.
|
These properties are inside of the WebSlides instance and they could be useful to achieve new behaviors.
|
||||||
|
|
||||||
- `el`: The DOM node to which WebSlides is attached.
|
- `el`: The DOM node to which WebSlides is attached.
|
||||||
- `isMoving`: A Boolean indicating whether a transition is happening.
|
- `isMoving`: A Boolean indicating whether a transition is happening.
|
||||||
@@ -128,6 +129,8 @@ WebSlides fires events on the WebSlide's element.
|
|||||||
|
|
||||||
Called once WebSlides has been initialised and the `initialised` flag is set to `true`. This happens _after_ all plugins have been created and all Slides have been parsed (in that order).
|
Called once WebSlides has been initialised and the `initialised` flag is set to `true`. This happens _after_ all plugins have been created and all Slides have been parsed (in that order).
|
||||||
|
|
||||||
|
> This will happen *synchronously* at the same time the instance is created so make sure you place your event listener *before* the constructor is instantiated.
|
||||||
|
|
||||||
#### `ws:slide-change`
|
#### `ws:slide-change`
|
||||||
|
|
||||||
Called once the slide **has finished** transitioning into view. The `event.detail` contains the following information:
|
Called once the slide **has finished** transitioning into view. The `event.detail` contains the following information:
|
||||||
|
Reference in New Issue
Block a user