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

Resizing an element

In this recipe, we will cover how to resize an element on screen by animating a change in its height and width. We will resize a container div, enlarging both the width and height.

Here we can see the key steps in this animation by looking at a selection of frames:

Resizing an element
Resizing an element
Resizing an element

How to do it...

We begin by creating a PHP page to set up a basic Moodle programming environment. In this case, anim_resize.php, with the following content:

<?php require_once(dirname(__FILE__) ...

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