Search Header Logo

JavaScript Animation Quiz

Authored by Asfia Asif

Computers

7th Grade

Used 3+ times

JavaScript Animation Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the myMove() function do in the given code?

Changes the background color of the container

Moves the red box diagonally across the container

Resizes the red box continuously

Rotates the container

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of clearInterval(id) at the start of the myMove() function?

It resets the box position to the starting point.

It stops any previously running animations to prevent overlap.

It deletes the animation element from the DOM.

It slows down the animation speed.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when the pos variable reaches 350 in the frame() function?

The animation continues but slows down.

The animation resets back to the start.

The animation stops moving the box.

The box changes color.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods is used to repeatedly execute the frame() function?

setTimeout()

setInterval()

requestAnimationFrame()

runInterval()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How often does the frame() function execute?

Every 5 milliseconds

Every 10 milliseconds

Every 50 milliseconds

Every 100 milliseconds

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following line of code do? elem.style.left = pos + 'px';

Moves the element vertically down by pos pixels.

Moves the element horizontally to the right by pos pixels.

Increases the size of the element by pos pixels.

Rotates the element to the right by pos degrees.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which CSS property allows the red box to move inside the container?

float: left;

position: absolute;

display: block;

align-items: center;

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?