From the course: reveal.js: Online Presentations

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Customizing themes with the data state

Customizing themes with the data state

From the course: reveal.js: Online Presentations

Start my 1-month free trial

Customizing themes with the data state

Reveal.js has an interesting feature called a data state. It adds a class to the HTML element and you can use that class in special places in your HTML to control the way a specific slide looks. It's the way that you used to do backgrounds and now they're handled a little bit differently. So something like this Would be done with some HTML code, data attributes. So as you can see right here we have data background images bridge and that's how we're doing those backgrounds. The old ways to do this is by adding a data state and some sort of label right here, so I'm going to use the label slide show right now. This is the photo of the bridge. So if I do that if I go here and refresh the page I'm going to right click on my mouse and select inspect element. Since I'm in this slide, I can see that there is an additional class on the HTML element called slideshow. We click right here on the slide, and then hit the down arrow. You can see that that class goes away. It only appears whenever…

Contents