Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
reveal.js - hotkey to jump to/from a named slide
keyboard: {
// '0' key will jump between current slide and slide-X
48: function() {jumpSlide()},
function jumpSlide() {
// The id of the slide you wish to jump to/from
target = "slide-X";
slide = Reveal.getCurrentSlide();
// If we're on the target slide, jump to original slide, if there was one
if ( == target) {
Reveal.slide(orig['h'], orig['v']);
else {
// 'Save' the current slide's index to jump back to later
orig = Reveal.getIndices();
// Jump to the target slide
jump = Reveal.getIndices(document.getElementById(target));
Reveal.slide(jump['h'], jump['v']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.