Skip to content

Commit

Permalink
documentation for navigationMode #2307
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Jan 23, 2019
1 parent 51b1658 commit 2fa3ab6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,8 @@ Reveal.initialize({
// Change the presentation direction to be RTL
rtl: false,
// When this is enabled, stepping left/right from a vertical stack
// to an adjacent vertical stack will land you at the same vertical
// index instead of the top.
gridNavigation: false,
// .
navigationMode: 'default',
// Randomizes the order of slides each time the presentation loads
shuffle: false,
Expand Down Expand Up @@ -523,15 +521,15 @@ Slides can be nested within other slides to create vertical stacks (see [Markup]
<img src="https://static.slid.es/support/reveal.js-vertical-slides.gif" width="450">
#### Grid Navigation
If you are on a vertical slide and step right onto an adjacent vertical stack, you'll arrive at the top of that stack. Consider a deck with six slides organized in two stacks like this:
```
1.1 2.1
1.2 2.2
1.3 2.3
```
If you're on slide 1.3 and navigate right, you will normally move from 1.3 -> 2.1. If you prefer remaining at the same vertical index and going directly from 1.3 -> 2.3 you can enable the `gridNavigation` config option: `Reveal.configure({ gridNavigation: true })`.
#### Navigation Mode
You can finetune the reveal.js navigation behavior by using the `navigationMode` config option. This option supports the following values:
| Value | Description |
| :--------------------------- | :---------- |
| default | Left/right arrow keys step between horizontal slides. Up/down arrow keys step between vertical slides. Space key steps through all slides (both horizontal and vertical). |
| linear | Removes the up/down arrows. Left/right arrows step through all slides (both horizontal and vertical). |
| grid | When this is enabled, stepping left/right from a vertical stack to an adjacent vertical stack will land you at the same vertical index.<br><br>Consider a deck with six slides ordered in two vertical stacks:<br>1.1 2.1<br>1.2 2.2<br>1.3 2.3<br><br>If you're on slide 1.3 and navigate right, you will normally move from 1.3 -> 2.1. With navigationMode set to "grid" the same navigation takes you from 1.3 -> 2.3. |
### Touch Navigation
You can swipe to navigate through a presentation on any touch-enabled device. Horizontal swipes change between horizontal slides, vertical swipes change between vertical slides. If you wish to disable this you can set the `touch` config option to false when initializing reveal.js.
Expand Down
6 changes: 2 additions & 4 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@
// all slides (both horizontal and vertical).
//
// "linear"
// When this is enabled, the left/right arrow keys step through all
// slides (both horizontal and vertical) in a linear way. If the
// presentation has no vertical slides this setting is identical
// to "default".
// Removes the up/down arrows. Left/right arrows step through all
// slides (both horizontal and vertical).
//
// "grid"
// When this is enabled, stepping left/right from a vertical stack
Expand Down

0 comments on commit 2fa3ab6

Please sign in to comment.