thejsway / thejsway

The JavaScript Way book

Home Page:https://thejsway.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Correct typo in charter 18

phucthaidoan opened this issue · comments

  • Typo:

Section: https://github.com/bpesquet/thejsway/blob/master/manuscript/chapter18.md#kick-off-a-repeated-action

which can bu used to further modify it => which can be used to further modify it

`// Move the block to the left
const moveBlock = () => {
// Convert the left position of the block (value of the form "XXpx") to a number
const xBlock = parseFloat(getComputedStyle(blockElement ).left);
// Move the block to the right
blockElement .style.left = (xBlock + movement) + "px";
// Have the browser call moveBlock as soon as possible
requestAnimationFrame(moveBlock);
};

const frameElement = document.getElementById("frame");
const blockElement = document.getElementById("block");

// Movement value in pixels
const movement = 7;

// Start the animation
requestAnimationFrame(moveBlock);`

Thanks,
Phuc Thai

Thanks for your help. Would you mind creating a pull request to correct these mistakes?

Sorry for my late response. It seems that they are corrected.