Skip to content

Can step-by-step code highlights each have unique timing? #3437

Answered by hakimel
mattcen asked this question in Q&A
Discussion options

You must be logged in to vote

You can achieve this by adding fragments with data-autoslide at the same fragment index as your code highlights.

  1. Set data-fragment-index="0" on the highlighted code block. The first code highlight has fragment index 0, the second is 1 and so on.
  2. Set data-fragment-index on each of your fragments so that they appear at the same time as the code highlights.
  3. Set data-autoslide on each of your fragments and the code highlight will remain visible for the same duration.

Here's a full example:

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="dist/reset.css" />
    <link rel="stylesheet" href="dist/reveal.css" />
    <link rel="stylesheet" href="dist/theme/black.css" />

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hakimel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants