Make an Image Float with JavaScript, HTML, and CSS

A quick way to add style to your web design.

We’ll start by capturing our image from the DOM and determining the center, x & y, coordinates of our image.

Let’s break apart the x & y axis of our animation…but first we need an animation loop.