Summary

In this chapter, you learned how to build a jigsaw puzzle that turns into a video clip. The techniques included the following:

  • Dynamically creating HTML markup to create elements
  • Defining event handling for mouse events and touch events
  • Changing the style.left and style.top attributes to reposition elements on the screen
  • Placing the jigsaw pieces randomly on the screen
  • Determining the coordinate values that indicated how the pieces fit together and using those values, along with a defined tolerance, to check if the jigsaw puzzle was put together adequately
  • When appropriate, making the video appear and play

In the next chapter, we tackle another project that includes a jigsaw puzzle, along with other possible moves by the player. Because ...

Get HTML5 and JavaScript Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.