HTML and CSS Reference
In-Depth Information
are involved, depending on the complexity of the desired behavior in between the start
and end of a drag-and-drop sequence.
Table 7-1
describes the relevant events and when
they are triggered.
Let's create a file that logs each of these events to the console. Duplicate the
jstem-
plate
directory from earlier and rename it
dnd
. Begin by editing
index.html
to
look like the following:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML5 Apprentice</title>
<link rel="stylesheet" type="text/css"
href="css/styles.css" />
<script
type="text/javascript"
sr-
c="js/script.js" defer></script>
</head>
<body>
<section>
<h1
draggable="true"
id="draggable">Draggable</h1>
</section>
<section>
<h1
draggable="false"
id="droptarget">Drop Target</h1>
Search WWH ::
Custom Search