Book Image

HTML5 Multimedia Development Cookbook

Book Image

HTML5 Multimedia Development Cookbook

Overview of this book

HTML5 is the most significant new advancement the web has seen in many years. HTML5 adds many new features including the video, audio, and canvas elements, as well as the integration of SVG. This cookbook is packed full of recipes that will help you harness HTML5’s next generation multimedia features. HTML5 is the future.Whether you’re a seasoned pro or a total newbie, this book gives you the recipes that will serve as your practical guide to creating semantically rich websites and apps using HTML5. Get ready to perform a quantum leap harnessing HTML5 to create powerful, real world applications. Many of the new key features of HTML5 are covered, with self-contained practical recipes for each topic. Forget hello world. These are practical recipes you can utilize straight away to create immersive, interactive multimedia applications. Create a stylish promo page in HTML5. Use SVG to replace text dynamically. Use CSS3 to control background size and appearance. Use the Canvas to process images dynamically. Apply custom playback controls to your video.
Table of Contents (16 chapters)
HTML5 Multimedia Development Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Using the drag-and-drop API with text


While all browsers can natively drag images or links, dropping objects used to require complex JavaScript or third-party libraries. The drag-and-drop API is intended to provide an easier, standardized way to enable users to drop any type of object into an identified area. In reality, working with the API across browsers is a challenge. The main browsers currently supporting this API are Firefox, Chrome, and Safari.

Getting ready

Download the code for this tutorial at http://www.packtpub.com/support?nid=7940. The font used in the heading of this tutorial is from http://www.fontsquirrel.com, where you can also download a different font if you choose. This tutorial may not work with Internet Explorer. We will be creating a tic-tac-toe game that demonstrates how the drag-and-drop API works.

How to do it...

Open up your HTML editor and start by creating a basic HTML5 page. We will add two stylesheet links, one to support an @fontface font we will be loading...