O'Reilly logo

Moodle JavaScript Cookbook by Alastair Hole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fading out an element

In this recipe, we will produce a fade-out effect by animating a change in opacity of the element from 100% to 0%. This offers a more subtle approach to making an element become invisible than simply using CSS to change the visibility or display properties to hidden or none.

We can see the key steps in this animation by looking at the following selection of frames:

Fading out an element
Fading out an element
Fading out an element

How to do it...

We begin by creating a PHP page to load the Moodle ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required