From bc64fcef7ef45894d11b3d73ecb5eb3e411130e9 Mon Sep 17 00:00:00 2001 From: Antonio Laguna Date: Mon, 27 Feb 2017 20:14:41 +0100 Subject: [PATCH] Adding more docs --- docs/click-to-nav.md | 16 ++++++++++++++++ docs/technical.md | 1 + 2 files changed, 17 insertions(+) create mode 100644 docs/click-to-nav.md diff --git a/docs/click-to-nav.md b/docs/click-to-nav.md new file mode 100644 index 0000000..4f459ec --- /dev/null +++ b/docs/click-to-nav.md @@ -0,0 +1,16 @@ +## Click To Nav plugin + +This plugin is included by default but disabled. In order to enable it, the option `changeOnClick` must be passed as +`true`. + +```javascript +const ws = new WebSlides({ changeOnClick: true }); +``` + +This will make every click to navigate to the next slide except for clicks that happens on the following elements: + +* `input`. +* `select` or `option`. +* `button`. +* `a`. +* Any element with the attribute `data-prevent-nav`. diff --git a/docs/technical.md b/docs/technical.md index edde70b..85f5e3b 100644 --- a/docs/technical.md +++ b/docs/technical.md @@ -24,6 +24,7 @@ WebSlides constructor accepts an object with options. | Param | Type | Default | Description | |-----------|----------------|-----------|-------------------------------------------------------------------------------| | `autoslide` | `number` or `boolean` | `false` | Amount of milliseconds to wait to go to next slide automatically. | +| `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. | ```javascript