From the course: Scrollytelling: Creating a One-Page Web Experience

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Making scrollytelling more dynamic

Making scrollytelling more dynamic

- [Instructor] So we left off with a fine kind of way of doing things. We are effectively scrollytelling, we have a visual as text goes by, we can affect that visual by the text div floating past. And it's working, but it's really not the right way to do it because if I have like a whole bunch of divs with a whole bunch of different things that I want to have happen, and now I have to write like a million, if then statements. And by the way not to mention what if I decided at the last second to switch the order of these two divs? Now the second one I want to be orange and the third one I want to be blue. And now I got to remember to go back down here and swap these two colors, just seems like not the right way to do it so let me go back to the way it was for a second. One way I can do that is I can use data attributes built into HTML. So if I use the data attribute, which is just written this way, data dash and…

Contents