Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump back to the top of a vertical stack #3002

Closed
ericwongmusic opened this issue Aug 31, 2021 · 2 comments
Closed

Jump back to the top of a vertical stack #3002

ericwongmusic opened this issue Aug 31, 2021 · 2 comments

Comments

@ericwongmusic
Copy link

Is there a way to jump to the top of a vertical stack or vice versa to the bottom of the stack?

@Martinomagnifico
Copy link
Collaborator

There is a simple javascript way to do this, using the provided Reveal tools.
This example uses basic buttons with classes .to-top and .to-bottom:

document.addEventListener('click', function (event) {
	if (event.target.matches('.to-top')) {
		event.preventDefault();
		let currenth = Reveal.getState().indexh;
		Reveal.setState({indexh: currenth, indexv:0})
	} else if (event.target.matches('.to-bottom')) {
		event.preventDefault();
		let currenth = Reveal.getState().indexh;
		let lastnr = (Reveal.getCurrentSlide().parentNode).getElementsByTagName('section').length;
		Reveal.setState({indexh: currenth, indexv:lastnr})
	} else return
}, false);

I think this issue can be closed.

@hakimel
Copy link
Owner

hakimel commented Sep 6, 2021

I've added support for holding shift and pressing the up/down arrow keys to jump to the either end of a vertical stack. We already had shift+left/right bound to jumping to the first/last horizontal slide so I think it makes sense to be able to do this vertically too. 90bbe8b

@hakimel hakimel closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants