Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to slide upwards with reveal.js?

With reveal.js one can have not only horizontal slides, but also add a second dimension by sliding vertically:

<section>slide1</section>
<section>
  <section>slide2 A</section>
  <section>slide2 B</section>
  <section>slide2 C</section>
</section>

However, it seems to be only possible to start with the first subsection on top (slide2 A) and then slide further down to the subsequent sections. Goal: After slide1 I want to start with slide2 B, and then have the option to go upwards to A or downwards to C.

Just in case that there is just no a solution for it, would it be possible to have slide2 B at the same vertical level as slide1, and to fix the slide order to be: slide1 -> slide2 A -> slide2 B -> slide2 C ?

The reason is that I have a parallax background with stars on top, sky and ground below. I need to have the sky on slide1 (and all other horizontal slides). Afterwards, I need to slide upwards to the stars, then down again to the sky and further down to the ground. So an alternative solution could also be to simply move the background between the three vertical slides?

like image 304
Martin Avatar asked Jan 31 '26 07:01

Martin


2 Answers

for anyone using markdown and reaching here with this question, you can write:

---
title: Demo
date: 2019-04-23
---

# slide1

---


# slide2

-- 

## slide2 A

-- 

## slide2 B

-- 

## slide2 C

like image 173
Chris Avatar answered Feb 02 '26 21:02

Chris


To use Markdown with Vertical Slides:

  1. Index.html
<section data-markdown="link-to-markdown-file.md" data-separator-vertical="^\n\n"e></section>

data-separator-vertical means that 2 new lines will create a vertical slide.

  1. link-to-markdown-file.md
# Slide Title
Hello World


## Vertical Title
Sub-slide

Note how there are 2 new lines in the second file, which tells reveal.js that a new vertical slide needs to be placed.

like image 33
anthonyjdella Avatar answered Feb 02 '26 19:02

anthonyjdella