mathiasp
mathiasp

Reputation: 91

How to inhibit left/right navigation in reveal.js

I need to write a presentation for others to use.

The presentation structure looks like a reverse T, i.e. it starts on top, goes 5 slides down, and then it can go left (more general) and right (more specific).

The presenters now go left/right too early, before going fully "down", so I have to stop them from being able to do this.

They work on iPads, so, sadly, just hiding the controls does not work (because of the touch events)

I'm not really fluent in Javascript, so if someone has a solution for this or can point me in the right direction I would be most grateful.

Thanks, Mathias

Upvotes: 0

Views: 1270

Answers (1)

Delyan
Delyan

Reputation: 8911

I realize this might not be useful in your case, since it doesn't change the arrow controls in the actual deck but here's how I made the keyboard arrows more sensible on a desktop browser:

Reveal.configure({
  keyboard: {
    37: Reveal.prev, // left
    38: Reveal.prev, // up
    39: Reveal.next, // right
    40: Reveal.next, // down
  }
});

In your case, this is where the handlers for the on-screen buttons are in reveal.js: https://github.com/hakimel/reveal.js/blob/master/js/reveal.js#L2955

You can modify them to call prev/next instead.

Upvotes: 1

Related Questions