How can I interactively jump to a specific slide?
Programmatically, I can use Reveal.slide( indexh, indexv, indexf).
For instance, in S5, I can enter the slide number and then press Enter.
There are succinct instructions for overriding the default keybindings in the Reveal.js Documentation. They say this:
Reveal.configure({
keyboard: {
13: 'next', // go to the next slide when the ENTER key is pressed
27: function() {}, // do something custom when ESC is pressed
32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding)
}
});
Keycodes for numbers 1-9 are 49-57 (0 is 48), so my read of the reveal.js event.keycode
switch suggests you want something like:
Reveal.configure({
keyboard: {
56: slide( 8 ),
}
});
I'm not much of a jQuery whiz, but writing a function that notes any additional digits and waits for enter before jumping to slide n
seems like a sort of advanced beginner level challenge (and a question that plenty of folks here could help you with). Question: what should happen if I type a non-number before I get to enter? What does 5qenter do?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With