From the course: Interactive Animations with CSS and JavaScript

Unlock the full course today

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

Manipulating DOM with JavaScript

Manipulating DOM with JavaScript

From the course: Interactive Animations with CSS and JavaScript

Start my 1-month free trial

Manipulating DOM with JavaScript

- [Instructor] So, we have now managed to get to the point where we're gonna trigger our random learning montage. And, in order to do that, we need to figure out a way to invoke some JavaScript at this specific point in the presentation, and then I want to display this random collection of images. And the way this is gonna work is you'll see a shape, and I'm gonna pick a shape at random from our list of four available shapes, and what I want to do is keep showing them on the screen, and I want this to accelerate. So, I want it to be faster and faster and faster, and whenever the shape is a circle, I want to show my "yes" indication. When it's not a circle, I want to show my "no" indication. So, we're gonna handle this in a couple of steps. The first step is, I wanna have a way to kind of cleanly invoke some JavaScript when we get to this slide, and the easiest way I've found in the past to do this is to actually encode the JavaScript function name into my mark-up. So let's go back to…

Contents